0 Replies - 5502 Views - Last Post: 16 January 2013 - 02:58 AM Rate Topic: -----

#1 JL29  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 50
  • Joined: 20-May 10

[JAVA][LWJGL] Skinning them bones

Posted 16 January 2013 - 02:58 AM

Hey DIC!

I'm trying to create a skeletal animation in opengl. So far the skeleton is working!
The problem is trying to figure out how to skin the mesh.

Posted Image

see? The mesh turns into some kind of bio-experiment using nuclear explosions.
The current way I transform the vertices is as follows:
v = Vector3f.sub(v, j.globalpos, v); //substract global joint pos
v = Vector3f.add(v, j.localpos, v); //Add joint offset
				
Quaternion RQ = j.globalrot; //get global rotation (local rotation+parent rots)
v = RQ.times(v); //rotation quaternion * vertex position (No weights, just move the anorexic vertex)
				
//v = Vector3f.add(v, j.globalpos, v); //add global joint pos does not work either way



I expected the vertex to go to the skeleton origin + joint offset + offset of vertex compared to the joint pos. (NOTE: the mesh origin is at the same spot as the skeleton origin!) Then I expect it to rotate by the globalrot. Instead its as if the vertex rotates around another origin that isn't correct.

Could someone help me with this?

And yes... I am aware of the seperated vertexes but that is not the problem. :P

This post has been edited by JL29: 16 January 2013 - 03:04 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1