PDA

View Full Version : Help with animating 3D object



wazoo69
09-28-2000, 06:14 PM
Hi,
I don't know if this is a FAQ or not, but I'd PLEASE like some insight as to how I can import a 3d model (which I've found code for) into my opengl program and then animate it!

ie. I have a space ship model. I can import it and display it, but how can I do things like turn the gun turrets, etc. Do I make each of these as seperate objects and then render them all together as a "ship" object? Or is there a simpler/faster way??? (there must be)...

Antonio
09-28-2000, 06:27 PM
Animating parts of an imported model is always a complicated subjec. Basically you must be able to import your model in pieces, or at least identify the parts. If you can render them separately you can animate them, otherwise...

Antonio www.fatech.com/tech (http://www.fatech.com/tech)

wazoo69
09-28-2000, 07:05 PM
So you mean that in games like Quake2 or whatever, they model and import EACH body part?? ie. 2x monster arms, legs and then a chest, head and waist???

Or for a spaceship a model for EACH of the sections that move?? (ie. like a space-station having some interstellar sonar dishes, etc)....

NOT flaming you btw., I'm just amazed that there's not really an easier/cleaner way..

thanks,
Wazoo69

Quint
09-29-2000, 12:52 AM
When it comes to mechanical objects, that's really the easiest way (several smaller objects joined together to form a larger object), but in your example of Quake2, I think they might be morphing between serveral character objects (not sure though, and it's not in any way easier than using several small objects), which means that they load perhaps 20-30 different versions of the character walking, fireing it's gun, etc, then morph between these different stances to create a fluid motion.

DFrey
09-29-2000, 06:16 AM
It is definately a good idea to use separate models for such things like turrets, and comm dishes. Why? Reusability. You can load just one turret model into memory and then draw it where ever there is a turret of that type. The tricky part, and it isn't all that difficult, is mating two models with a potential arbitrary alignment, e.g. drawing turret on top of ship and drawing same model underneath, or on a side of the ship. Or you could put that burden on the artists and have them make turret models for each of the given orientations. That requires more memory though.

Dodger
09-29-2000, 11:31 AM
If you don't want to import color or texture information, there would be the possibility to give each separately animated part of the model its own color, then read the color information from the 3d file and use all polygons/vertices of the same color to determine animated object parts.

It pretty much depends on what type of file you're importing though, many 3d object files are structured for having 'sub-objects'.

Another possibility _might_ be, to build your objects as a scene file (each separate animated part being one object in the modeler) and importing the scene file.

Quake 1 and 2 use simply a series of animation phases... first comes a cloud of 3d points, then the definition which vertices span which triangle and then texture coordinates. This is repeated for the number of animation phases in the model. IMHO not in Quake 1 and 2, but 3, they interpolate between the animation phases to make the animation look smoother (keyframe interpolation).