How does maya / 3ds max interact with OpenGL/D3D?

I think I've asked something like this before but I'm still not clear.

You can draw triangles and shapes using OpenGL but can't create complex shapes/entire levels. This is where a modeling program comes in. Suppose I model a mech in maya, how do I get a simple openGL engine to render it? Is the mech file exported in some specific format and are there specific calls made in OpenGL to open it?

And also, why do devs make their own level editors? They use these to make levels but use maya to animate their characters. What's the difference?

Essentailly I'd like to know the LINK (when desiging a game) between say:
OpenGL -> Maya -> UT Level Editor -> UT Graphics Engine

How do they all interact?

PS. So you kno what I'm actually doing: I've made a half complete model in maya. I'd like to make a VERY simple 3D engine which can take this model and light it. I'd like basic key input so I can roate, and change to new camera viewports. Then from there, I'd like to add a background/terrain to the world and texture the model. Hopefully eventuall it can be bump mapped/shadowed/particle effects. I have rudementary understanding of C but not OO C++, and solid with photoshop type apps. How far off am I from each milstone?
 
For getting a 3d model into your code try something like the 3ds exporter at
http://www.pvrdev.com/tool/index.htm

In general (this is pretty much educated guess work as I don't do any 3d programming).
Maya/3DS will output a file with the parameters required to render the object. This may or may not include lighting. A level editor will output data that will be optimal for the games 3d engine i.e. BSP partitioning, lighting etc. In addition to the geometry and materials which you get from your 3d modeling package, the level editors will contain some kind of behaviour control, such as this is a lift which can go from a to b. Or this is a door which opens when player gets near it. So a level editor will probably consist of geometry + game specific data, possibly pre compiled in some way that will allow the game to load quicker.

At the moment it sound like you are some way from your goal, your main goal (in my opinion) should be to improve your C coding skills, the best way to do this is just to write code, so as you develop your project your coding will improve.

I can recommend
http://nehe.gamedev.net/
as a good place to visit for opengl, their are some good tutorials which develop and build ontop of each other.

Hope this helps,
CC
 
I think a very good way to get data from Maya or 3ds max is to export to the .obj format and read that into your OpenGL engine. The obj format is great for static meshes and because it is a text format it's great for beginners. I'm still a beginner myself. For your purposes vertices, vertex normals, and texture coordinates are all you need in your obj file.

Concerning the relationship between level editors and Maya. I think many companies develop custom level editors because it is just as easy to do that as to heavily modify Maya. Plus there's the bonus of having a streamlined interface that only does level editing. Who knows, it might just save them money as well because level designers won't need a license for Maya.
 
Just simply export your model/scene to .3ds or whatever model format you want to use, load it into your GL app and then render it.

About engines having their own level editors... Maya and max cost alot of money, but level editors are usually free or come with the game itself. Also, Maya and max aren't optimised for the Unreal or Quake engine. It is alot more tedious to get your level from a modeller to your engine than it is with a level editor designed for the engine. Usually you just click build, run the game and it's all done.
 
Luke Philpot said:
Just simply export your model/scene to .3ds or whatever model format you want to use, load it into your GL app and then render it.

And how exactly do I just *load* it.

Say I've got a 30 line GLUT peice of code to display a triangle. How do I just cut the trianlge code out and put in a 40 000 triangle model in maya binary format in an arbitary directory?
 
MS has .X exporter for Maya, I think it comes with source as well. You can download it from DirectX page. You might want to try .X, but I don't know, if this is a solution for you.

Say I've got a 30 line GLUT peice of code to display a triangle. How do I just cut the trianlge code out and put in a 40 000 triangle model in maya binary format in an arbitary directory?

If your code is just drawing simple triangle at the moment, you can get the triangle info from .obj files. Than you just draw them one by one. You might want to get the normal from .obj as well (or calculate it yourself), if not it'll look flat.

With 40,000 tri, you probably want to strip it and index it though.
 
If you're using pure C++ and OpenGL, then unfortunately you need to write your own format importer. I recommend OBJ format because it is the simplest and it is pretty capable. You can google for the OBJ format (its specifications are widely known). Once you have done this, you can go searching for models and if they aren't in OBJ format, you can convert them using a conversion tool like Pipeline3D from www.kalsaya.com.

I think I've asked something like this before but I'm still not clear.

You can draw triangles and shapes using OpenGL but can't create complex shapes/entire levels. This is where a modeling program comes in. Suppose I model a mech in maya, how do I get a simple openGL engine to render it? Is the mech file exported in some specific format and are there specific calls made in OpenGL to open it?

And also, why do devs make their own level editors? They use these to make levels but use maya to animate their characters. What's the difference?

Essentailly I'd like to know the LINK (when desiging a game) between say:
OpenGL -> Maya -> UT Level Editor -> UT Graphics Engine

How do they all interact?

PS. So you kno what I'm actually doing: I've made a half complete model in maya. I'd like to make a VERY simple 3D engine which can take this model and light it. I'd like basic key input so I can roate, and change to new camera viewports. Then from there, I'd like to add a background/terrain to the world and texture the model. Hopefully eventuall it can be bump mapped/shadowed/particle effects. I have rudementary understanding of C but not OO C++, and solid with photoshop type apps. How far off am I from each milstone?
 
I can echo the "export an .obj, write code to read it in your program, and then draw the triangles one by one" idea.

You can then move to more advanced things.

For OGL or D3D, you'll read in an obj file, change the data to fit what D3D or OGL accept, and then pass the data to whichever. Rendering a basic scene is trivial, its the scene setup (how and what data to give to OGL/D3D) that you will have problems with.
 
Um, is this a 5 year necro purely to sell something? lol
 
People, this thread is from 2003!! The topic starter is either a professional by now or he long quit the job...
 
Back
Top