Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » A return to 3d Studio 3ds files

This thread is locked; no one can reply to it. rss feed Print
A return to 3d Studio 3ds files
Timothy Graupmann
Member #2,546
July 2002
avatar

With all the information at:
http://lib3ds.sourceforge.net
http://www.wotsit.org
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm
http://www.gametutorials.com/forum/topic.asp?TOPIC_ID=5281

I can't find any information on the object track hierachy.

Does anyone know how the animation tracks should be applied to a child object when the parent is an object?

Applying parent to child was straightforward when the parent is a group and the child is an object because you just apply the position, rotation, and scale tracks from the group to the object.

But what do you do if the parent is an object and the child is an object? Does that even make sense (how could an object be a parent)? The only thing I can think of is that by having a parent object you get the effect that the objects are linked. In that case what should be done? Find a common vertex between the two and pivot on that?

Any ideas?

gillius
Member #119
April 2000

I'm not exactly sure why you differentiate groups and objects... I'm not sure of the terminology in 3ds files, but if you are refering to hierarchal transforms (also could be rigid-bound skeletal animation), then the child gets its transform plus all of the transforms of its parent.

For example, the model will be in a tree structure. If each node has a transformation matrix (I'm figuring that's what you are doing), then that's all there is to it. Groups or objects I'm not sure what you mean. Anyway, each node has a matrix and a set of vertices attached to it. The final transform for a node is its own matrix multiplied by all of the matrices of its parents.

FinalTransform(root) := ReferenceTransform(root)
FinalTransform(x) := FinalTransform(Parent(x)) * ReferenceTransform(x)

Then you draw the vertices based on the final transform for their node. The reference transform is the transform of the child with respect to its parent, you could call this the "reference pose" if you were an artist. Slight special attention needs to be paid to "glue" polygons if you are using skinning and not just simple hierarchial transforms.

Gillius
Gillius's Programming -- https://gillius.org/

Korval
Member #1,538
September 2001
avatar

Quote:

But what do you do if the parent is an object and the child is an object?

Note: I have 0 knowledge about 3DS files, so take the following with a grain of salt. It could be completely wrong.

You should do the exact same thing you did if the parent was a "group": get the position/rotation/scale (heretofore refered to as a matrix) and apply that to its child objects.

Timothy Graupmann
Member #2,546
July 2002
avatar

Using 3d studio, the logic is in UI terms:
- You can select multiple objects and group them.

- What doesn't make since to me, is what the 3ds file says is that in some cases you can select multiple objects and attach them to an object.

The difference between a group and an object is that groups don't have verteces, faces, or materials.

The other things is that the object name of a group is "$$$DUMMY" (denotes group) and the following INSTANCE name is the actual name of the group.

Quote:

You should do the exact same thing you did if the parent was a "group": get the position/rotation/scale (heretofore refered to as a matrix) and apply that to its child objects.

That's the first thing I tried. But it doesn't work. The model appears disconnected at the joints.

For instance, legs are not quite attached to the body, knees are not quite attached to the upper leg, and the feet are stationary (or moving erratically).

I added 4 screen shots to my index page: http://tgraupmann.hypermart.net/index.htm

---------

Here is a better way to look at the problem:

The green sphere at the bottom is 0,0,0 for each object. All objects have a common 0,0,0 apparently?

The red spheres are each objects vertex[0] point.

http://tgraupmann.hypermart.net/3danimation/debug_cyborg4.jpg

The lower leg and foot are now moving together. Can you see why the upper leg and lower leg aren't pivoting together?

Go to: