Parent of a vertex

Blitz3D Forums/Blitz3D Programming/Parent of a vertex

syntax(Posted 2008) [#1]
is there any way to find a parent of a vertex? and if so, is there a way to set a parent to a vertex? Think of it as telling whether or not a vertex is attached to a pivot and then if it is, changing which pivot it is attached to. much like a joint or bone.
thanks


Leon Drake(Posted 2008) [#2]
i believe, from what ive heard you have to save all that information to a b3d file then reload it in order for the vertices to be weighted.


syntax(Posted 2008) [#3]
right. so after its loaded how would you go about changing which vertices are attached to which bones?


Beaker(Posted 2008) [#4]
You can't. You have to save all the weighting info into the file and then load it.

Also, you cannot find out what bone a vertex is parented to.


Leon Drake(Posted 2008) [#5]
i suppose what i would do is keep all the vertex info on hand in types, then save and reload to "apply changes".

then to edit them just edit the vertex type and save and reload.


Gabriel(Posted 2008) [#6]
Vertices don't have a single parent; they can be affected by up to four bones. So what you will actually need to store (if this is the purpose of the exercise) is four floating point values representing how much influence each of the four bones has over the vertex.


Dreamora(Posted 2008) [#7]
I would actually store it vice versa.
This means: Store the weight and the vertex index on the bone, as thats the way in which it is stored in the B3D as well.


Gabriel(Posted 2008) [#8]
I would store it that way too, but I'm not sure what the OP is using the information for, so perhaps it's not good enough to do it that way.


syntax(Posted 2008) [#9]
my problem doesnt really have anything to do with the weight of an vertex on a bone. exactly what i was trying to do was be able to load up one entity (lets call it belly) and then load up a different entity (lets call it chest) and then make the vertices along the lower part of the chest be attached to the belly's bone. that way they can act as the same object but i can call for either the chest or the belly to animate at different times.


Dreamora(Posted 2008) [#10]
That actually IS vertex weight.

A vertex is part of a surface and a surface can only be part of a mesh, not of a bone.
If you want a vertex react to a bone "directly" (ie not the mesh of which the vertex is part of reacting to the bone), then you must use vertex weights and especially store it and reload.


Leon Drake(Posted 2008) [#11]
i wrote a function for attaching b3d bodyparts like that here
http://www.blitzbasic.com/codearcs/codearcs.php?code=1917