How to import models
I''m new to game programming, but the first thing i want to do is import a model from Lightwave. I know Lightwave can export models in a variety of fortmats, but how do i display it in openGL and is it possible to keep the textures and create new animation using the same model.
Gord period
It''s not always an easy task to import 3d-modles but perhaps i can help ya a little bit:
Normaly there are the same steps you got to do read the vertice and face data , read the tex-coord data and perhaps if ya want or need additional material or color data.
There is mostly much more info in the model formats which ya can ignore.
When ya read the infos into your internal arrays, use it to render your model by using normal OGL rendering functions.
1. There is info on how to read a *.3ds (AutoCad) file on
www.wotsit.org which ya can use for mostly static models.
2. You can download the Quake1 sources to have a look on *.mdl models which ya can use for frame based animation models.
You can also get the format specification directly from one of the FAQs anywhere out the web.
There is also info on how to read quake2 and quake3 models.
(Quake3 md3 models use frame based skelet animations).
You can also download the HL-SDK there are sources of a HL-model viewer. HL uses real skelet animations ... which will be a little bit to hard to start with
P.S. here you can find the source of a md2-viewer written with OGL :
http://www.3dgamedev.com/code/sourcecode.asp
Normaly there are the same steps you got to do read the vertice and face data , read the tex-coord data and perhaps if ya want or need additional material or color data.
There is mostly much more info in the model formats which ya can ignore.
When ya read the infos into your internal arrays, use it to render your model by using normal OGL rendering functions.
1. There is info on how to read a *.3ds (AutoCad) file on
www.wotsit.org which ya can use for mostly static models.
2. You can download the Quake1 sources to have a look on *.mdl models which ya can use for frame based animation models.
You can also get the format specification directly from one of the FAQs anywhere out the web.
There is also info on how to read quake2 and quake3 models.
(Quake3 md3 models use frame based skelet animations).
You can also download the HL-SDK there are sources of a HL-model viewer. HL uses real skelet animations ... which will be a little bit to hard to start with
P.S. here you can find the source of a md2-viewer written with OGL :
http://www.3dgamedev.com/code/sourcecode.asp
So why don't you come here?<br/>You realy should come.
The .lwo format from lightwave can be found at newteks homepage and it´s pretty easy. The only thing you you can´t read from it is the texture coordinats but the algorithm for them is pretty easy too, just find some .doc for them (they will appear in almost every doc about raytracing) Yes you can keep the textures in memory when you load a new animation. Even the model can be keept in memory since the .lwo describes the model and .lws describes the animation =)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement