PDA

View Full Version : Game Engine using 3DS models



ksanim
04-09-2006, 11:29 PM
I'm interested in the possibility of using OpenGL to create a game engine which renders models created in 3D Studio Max. I have 3 questions.

1. Do I need to know any specific math concepts other than what's necessary for basic OpenGL rendering?

2. What are some resources I can look through to research this topic further?

3. How difficult would it be to pull this off, given that I have a solid foundation in OpenGL programming?

Thanks.

Claus Matthiesen
04-10-2006, 03:03 AM
Hi ksanim,

1. No, not really. There are some peculiarities in the way the data is structured in 3dMax but the mathematics are pretty much the same as is needed to understand OpenGL.

2. There are two paths you can take; focus on reading the data from a 3ds file or make a plugin for 3dmax which will let you save the data in your own format directly from max. There are freeware open-source 3ds readers out there but they are, of course, unsupported by Alias Wavefront. All in all, that is probably the easiest solution. The most beautiful solution is making the plugin - for that you need the 3d max sdk which is distributed along with 3d max itself (and which *is* supported by Alias). This is also where you will find the documentation, though it is pretty sparse. And I actually think that the max sdk is freeware so you might get a legal copy of the sdk if you know someone with max - but check up on this, I am by no means certain.

3. Depends on the level of sophistication. A simple engine without collision detection, lod and using a simple lighting equation is simple to make - but not very useful, of course... All in all, you'd probably need to team up with someone to get anywhere. And since, incidentally, I am working on something similar, let me know if you want to know more.

Cheers,
Claus

ksanim
04-10-2006, 03:16 PM
A couple more questions for you.

What concepts do I need to know to utilize OpenGL to recreate the 3DS models and textures in sharp detail?

I know the 3DS SDK can export animations. Anything special I need to do in OpenGL besides rendering the models' Character Studio frames whenever the screen is refreshed?

Claus Matthiesen
04-11-2006, 02:53 AM
As regards what you need to recreate 3ds models and textures in sharp detail - this is not really different from what you generally need to make your opengl renderings crisp and clear. Use of anisotropic filtering is generally a very good idea. But by looking around on opengl.org and googling the subject you can find many tricks which generally will speed up or make better the image you're rendering.

I would recommend, though, making a relatively unsophisticated implementation to begin with and then add the niftier features later. Once you have the framework and it's working, it's much easier to add the "sugar".

I have to admit that I don't know too much about the details of the animation system, however I do know that one of the things 3d max gived you is the expected framerate for its animations. You should not update to a new 3ds frame every time you have an opengl frame; a framerate in opengl of 200 fps is not unrealistic and I believe 3ds normally expects animation framerates of about 25-30. Actually, we had a nifty bug the other day where an animation had been cut short because the animation had been made under PAL which expects a lower framerate than NTSC - which meant that all the last frames of the animation were cut out...