OBJ Model Movement

Started by
12 comments, last by Daaark 18 years, 10 months ago
I am curious as to what the best (and proper) way for "movement" with OBJ 3D Model files (my friend creates the models while I program, so I dont have much knowledge with the modeling processes). Anyway, my question is what should I do for the movement of, let's say a character, that is an OBJ Model file? Such as if I currently have a character standing still and I want him or her to switch to a walking model, would I simply load and display the walking model rather than the standing model or is there a way to have all of the different "stances" compacted into one model and I can switch inbetween the various "stances". If it helps at all, I am coding in Visual Studio .NET 2003 with C++ and I am trying to use OpenGL with SDL (for cross-compatibility) Thanks for any great help; your forum has given me alot of great ideas and solved many problems over the years :D
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Advertisement
The obj model format doesn't store any animation information. It just stores a scene, and it's material information.

[Edited by - Vampyre_Dark on June 16, 2005 4:45:51 PM]
alright, thank you much.

I will probably have each "stance" in a separate model, then, and hold the "status" of a character in an enum variable.
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Quote:Original post by codemastermm
alright, thank you much.

I will probably have each "stance" in a separate model, then, and hold the "status" of a character in an enum variable.


You mean 1 model per animation frame?

Check out anim8tor (sic).

Import your model, rig it to a skeleton, then make and save your animations.

http://en.wikipedia.org/wiki/Skeletal_animation
so if i load that model and just display it in OpenGL just as i would a normal still model, it'll move and the such, even though in OpenGL i never set it to move at all?
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Quote:Original post by codemastermm
so if i load that model and just display it in OpenGL just as i would a normal still model, it'll move and the such, even though in OpenGL i never set it to move at all?


No. It's not going to render automatically. You will still have to position it, and then deform it based on the position of the bones in that frame.
i understand positioning easily, but what would i do for deforming it in relation to the bones?
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
codemastermm, what you are talking about is referred to as keyframe animation. Each "frame" of animation is stored in a separate file (in most cases). All you have to do is load each model ONCE at the init stage of your program (game). And just switch between the models when rendering. For example: Walking might be files / keyframes 1, 2 and 3. Jumping might be files 7, 8, and 9 - so when the player jumps, you cycle through frames 7, 8 and 9. Easy hey?
thank you much; it seems like a bit of a hassale but is logical.
is there an easy way to create all of the frame models? such as perhaps making an animation and then creating models for each frame of it?
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
You don't store every frame in a new file. And you don't create new models for every frame.

Creating new models and storing them for everyframe deafeats the purpose of using a skeleton! You keep 1 model, and you deform it around the current skeleton shape.


*Pseudo Code

Get the skeleton's pose. (a frame generated on the fly between 2 keyframes)
Deform a temp copy of your model around the pose.
Render it.


This topic is closed to new replies.

Advertisement