coordinates of vertices in animated meshes

Blitz3D Forums/Blitz3D Programming/coordinates of vertices in animated meshes

_pc(Posted 2004) [#1]
I have a problem, I would like to obtain positions x, y, z, of vertice animated. I have written east code, but it does not work. Somebody like making it, greetings.

;--------------------------------------------------------
Graphics3D 640,480,16,2
SetBuffer BackBuffer()

cam = CreateCamera()
MoveEntity cam,0,35,-50
luz = CreateLight(2)
MoveEntity luz,0,35,-50

personaje = LoadAnimMesh("personaje.b3d")
piel = FindChild(personaje,"Emale02")

Animate piel,1,0.3

child = GetChild(personaje,1)
superf = GetSurface(child,1)

While Not KeyHit(1)

TFormPoint VertexX(superf,1),VertexY(superf,1),VertexZ(superf,1),piel,0

UpdateWorld()
RenderWorld()

Text 10,10,VertexX(superf,1) + " " + VertexY(superf,1) + " " + VertexZ(superf,1)
Text 10,30,TFormedX() + " " + TFormedY() + " " + TFormedZ()

Flip()
Wend
End


Gabriel(Posted 2004) [#2]
I'm sorry, but you can't. Blitz does not track vertex positions in skeletal animation. You need to track the positions of the bones as those are tracked during animation and can be used for positioning things relative to a limb or whatever.


_PJ_(Posted 2004) [#3]
If you know the position and facing of the vertex on loading, could you add a pivot and parent it within the code?
The pivot in this case acting as a kind of vector tag?


poopla(Posted 2004) [#4]
I'd say just find the vert's offset to it's bone, then use that for location. You really don't want a million pivots to represent your vertices.


jfk EO-11110(Posted 2004) [#5]
if the bone is rotated, it may become pretty complicated. If there is only a low number of pivots, it may be the easiest way.


Gabriel(Posted 2004) [#6]
Yeah, really. If it's a hand vertex, it would be subject to the base bone, all of the spine bones, the shoulder bone, the upper arm, the lower arm and the hand. That would be a nightmare to calculate.

If you only need a few of them, I would definitely just create them as additional bones. Bones are just pivots anyway really, and putting them in place when you're rigging the character is probably easier than doing it in code.

Still until _PC explains what he needs it for, it's hard to pick the best option.