Ok, so I have this animated person_holding_gun mesh(md2 file) and want to actually put the gun on his hand. I do can get the current vertex data to get the hand’s vertex position when not animated, but, when the person is animated, the vertex data seems stays unanimated.
So, is there a way to get the vertex data from the animated mesh?
[ASK] How to get vertex data from animated mesh?Software: Away3D 4.x |
||
bart_the_13th, Newbie
Posted: 09 January 2013 10:22 AM Total Posts: 14 |
||
Rasterizer, Member
Posted: 09 January 2013 10:29 AM Total Posts: 69 [ # 1 ] I think the way this works is that you attach the object to the SKELETON’s HAND, not the mesh itself. I will be facing this issue soon as well and preliminary research seems to be pointing in that direction. |
||
bart_the_13th, Newbie
Posted: 09 January 2013 10:46 AM Total Posts: 14 [ # 2 ] Well, I do think using skeleton based animation will be the best solution considering I need to rotate some body part after animating too… |
||
Rasterizer, Member
Posted: 09 January 2013 10:53 AM Total Posts: 69 [ # 3 ] I haven’t tried it, but if I was you, I’d put down index of a chosen vertice, then lookup that vertice’s position and normals at each frame and reposition my object according to it. |
||
bart_the_13th, Newbie
Posted: 09 January 2013 11:00 AM Total Posts: 14 [ # 4 ] Yup, that’s what I’m currently using
var gunPost:Vertex = this.geometry.subGeometries[0].vertexData[handVertexNumber];
to get the vertex position, but it seems that using subgeometries doesn’t take animation into account, so maybe I’m just using the wrong technique. Oh and I also do applyTransform to put the gun in the world position ( the result was in local position) |