Jump to content

asahi

Members
  • Posts

    4
  • Joined

  • Last visited

  • Days Won

    1

asahi last won the day on March 17 2015

asahi had the most liked content!

asahi's Achievements

Newbie

Newbie (1/14)

8

Reputation

  1. Here it is. https://github.com/PanXu86/publicfiles/blob/master/skeleton2.mp4
  2. I have uploaded a video of the skeleton you give to me at: https://github.com/PanXu86/publicfiles/blob/master/skeleton.mp4 (the horizontal line you can see in the video is just about the unused bone in the scml. And I also get all the bone position for 1st frame(0 ms) of the animation at here: Player_pelvis (5,40,0) Player_pelvis (3.97112,77.0397,0) Player_chest (4,81,0) Player_chest (4.5867,130.044,0) Player_head (5.68297,133.053,0) Player_head (50.97,267.108,0) Player_back_arm (31.4025,125.2,0) Player_back_arm (60.791,91.8076,0) Player_back_forarm (63.6757,90.5715,0) Player_back_forarm (64.298,67.2632,0) Player_back_hand (65.168,65.2072,0) Player_back_hand (52.2438,34.2198,0) Player_front_thigh (0,0,0) Player_front_thigh (200,0,0) .... for unused bone.
  3. Thank for the attention lucid. :) Yes, I am applying scale first. the sequence is scale->rotation->transform. I have tried to apply rotation first, the result get worse...
  4. Hi, Recently I have tried to integrate Spriter to my game by rendering it by myself. Before doing anything further I tried to render all the bone correctly. Here is the Grey Guy's bone looks like in Spriter: But what I got in my game is something like: There is a serious twist in the result I got, and I am not sure what goes wrong, seem it is related to non-uniform scale we have in greyguy skeleton. What I have done basically can be break done into following step: Get the Matrix of each bone by reading scml data. following code is related to bone matrix calculation. void Transform::ToMatrix( glm::mat4& mat ) const{ glm::mat4 scale(1.0f); scale = glm::scale(scale, m_scale); glm::mat4 rot = glm::toMat4(m_rot); glm::mat4 trans = glm::translate(glm::mat4(1.0f), m_trans); Matrix::Multiply(scale, rot, mat); Matrix::Multiply(mat, trans, mat);}void Matrix::Multiply( const glm::mat4& mat1, const glm::mat4& mat2, glm::mat4& output ){ output = mat2 * mat1;} Get the bone join coordinate by I am just doing (0.0, 0.0, 0.0, 1.0) * localMat * ParentMat1 * ..... ParentMatN Can you guys give me some lead about how could I fix this issue?
×
×
  • Create New...