Archived

This topic is now archived and is closed to further replies.

FXO

Transformation Keyframes

Recommended Posts

Hey there! I''m having some trouble with displaying .ms3d models from milkshape 1.56. It seems as if some of the vertices don''t have any bones.. I use the code from Brett Porters tutorial (thanks), it supports milkshape 1.3 and 1.4. Does anyone know how to get hold of the fileformat for the new versions of milkshape or have any idea of whats wrong? Thankful for any help...

Share this post


Link to post
Share on other sites
Hi there,

File format hasn''t changed, except that pathnames are relative which has introduced a bug in the tutorial. You can avoid that by using textures in the same directory as the executable and the model (or patch the code to put the model path on the front of the texture path as I have done for the next release). You''ll also have to remove the bit that checks MS3D version is 1.3 or 1.4.

The code should work with vertices that have no bones - it checks for bone = -1 and doesn''t do any modification of the vertices. If it is broken, please send me an example MS3D file.

HTH!

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I noticed that too. When I didnt have animations assigned to all of the child joints(meaning no rotations or transformations at all), the child joints wouldnt move. So you would get a weird stretching kind of animation with no movement by the children. It looks really bad but can be fixed if you rotate the children. Any idea why this is happening and how to fix it?

I have another question, almost completely unrelated(sorry). When I try to display bitmaps fonts(regular text) to the screen after drawing a model based on your animation tutorial, the text becoms black. I had the backround set to black and thought that the text was disappearing, but it was just turning from its normal orangish color to black. Now on a blue backround it is blakc font. Something is wrong, and it isnt the text because I have a button that allows me to switch on and off the drawing of the model. It is the model->draw() function that causes this(note: I am translating into the screen, drawing the model, then coming back out to where I started), and the text is black whether I draw the text before or after the model. What could be causing this?

Share this post


Link to post
Share on other sites
Anonymous Poster:
Yes, thats exactly what happens.
I looked now and noticed that (as you said) the only vertices that aren''t moving are those who doesn''t have any keyframes bound to their bone.

>TEXT COLOR
Are you sure that the model->draw() code doesn''t change any states in OpenGL?

Try putting "glPushAttrib(GL_ALL_ATTRIB_BITS)" in the beginning of the draw() function and "glPopAttrib()" at the end.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
wow thx, that worked.

I am an extreme newbie. Is there a tutorial anyone knows of that tells about the GLpush and GLpop commands, why they are usefull, and what they do? I really dont get it, because I have never seen anything like it, and the tutorials I read never really say anything about them. Also, is there anyplace I can find a nice conceptual overview of how OpenGL works, and what the various pats do?

Share this post


Link to post
Share on other sites
AP:

Try the red book and the blue book. You''ll see links floating around - I believe Romka Graphics has a downloadble version at http://romka.demonews.com

You can see more about the various states there, or in the OpenGL documentation from MSDN if you have MSVC

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites