View Full Version : File format question
Gershon 03-06-2005, 02:14 PM hi, i've setup a simlpe OpenGL engine that loads wavefront OBJ, looks great so far
but i wanna load animations too. so my question is which file format should i use?
i'm using Wings3d for modeling and Blender for animations, which has python scripts to export to a few formats...
i think my current options are either .x or .3ds , but i'd love to find a good ascii format.
|
|
Gershon
03-08-2005, 09:54 PM
well... i went ahead and picked the ascii .X format, basically just coz i'm using Blender...
anyways, i'm a noob so i'm having some problems, i've transposed the FrameTransformationMatrix data to the opengl style but i'm kinda stuck with it...
i tried using glLoadMatrix and MultMatrix , both got it wrong.
help!
rakmaya
03-10-2005, 03:45 AM
Choosing .X format was a good decision as that supports many things that 3ds and obj has trouble with. And more 3D packages comes with a .X file exporting tool to save you time if you work in other packages.
Now for animation; I am not sure how Blender uses the IK or "Frames" system. You have to keep the Heirarchial struture. That is if Object A is a parent of Object B, Object B's FrameTrasform must be multiplied by Object A's FrameTrasform.
If you explain the problem we can look it more closely.
For now, here is a small infomation for IK/Bone animation system. I am not sure how much of the below you have to actually code it. If my guess is correct and since Blender makes things easy anyway, you shouldn't have to multiply or deal with low level stuffs. Just in case, the below info should help you.
Bones are created from Prent->Child(multiple Siblings also) relation. This means that you have recurse through the bone structure.
For example
Bone 1: UpperArmFrameTrasformMatrix (A Matrix)
BoneOffsetMatrix (A Matrix)
Bone 2: LowerArmFrameTransformMatrix (A Matrix)
BoneOffsetMatrix (A Matrix)
Bone 3: Fingers 1FrameTransformMatrix (A Matrix)
BoneOffsetMatrix (A Matrix)
Bone 4: Fingers 2FrameTransformMatrix (A Matrix)
BoneOffsetMatrix (A Matrix)
From this you see that for actual motion of Finger is effected by the LowerArm which intern is effected by the UpperArm.
So to actually create a "Combined Trasformation Matrix" for Finger you have to do this:
Finger1Combined = UpperArm.FrameTrasform * LowerArm.FrameTransform * Finger1.FrameTransform
BUT before you push the Matrix onto the stack (or to the palette), you have to do one more multiplication; that is:
FinalTrasform = Finder1Combined * Finger1.BoneOffsetMatrix
That is how the Bone or ANY Framed systems work
CGTalk Moderation
03-10-2005, 03:45 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.