loading 3d objects into OpenGL at Runtime...


#1

Subject:
loading 3d object in OpenGL

Hello !

I hope the problem I have is an easy one. I want to

  1. build my objects in 3ds Max (Version 6),
  2. export them into Format xy,
  3. then load and display these 3d objects into my C++ OpenGL application

at Runtime (so not included in the source, but having the model and

textures loaded from the filesystem, yeah, at Runtime)

Questions:
1) What is a good Format xy? (md2,md3,3ds,… ?!?)
“good” is defined by:
2) Is there a recommendable Exporter for it?
(hopefully without too many manual inbetween steps…)
3) and a public available C++ Loader (incl textures)?

I am aware of the usual Realtime Graphics restrictions:
all geometry becomes polygonal (I dont need any moving parts anyway), a single “skin” texture is fine, same about restriction to 2^n,m texture sizes…

must-haves:
a) reusing objects in a frame (like GL-“displaylists”), i.e. using a

lamppost along a road a dozen times (still having it in memory only once, ideally displaylist-like on the graphics card for performance)

b) texture mapping coordinates most work properly

would-be-nice:
c) having more than the diffuse texture channel, i.e. specular,
properly exported
d) alpha transparency (i.e. have a tree with alpha info just on a rectangle) and alpha against the material (i.e. a small label on a big object)…

e) multi-layer texturing (as in "ARB_multitexture) is not a must, though I sure “don’t mind” hearing about it :slight_smile:

Thank you for help!

Frank


#2

This is quite easy, all you have to do is read a model file, and literally draw the polygons and texture info in your render function. Or use display lists to speed it up

You could use your own fileformat, but I think it would be easier to use a pre-existing fileformat instead.

Have a look at this page, look further down, it has a few loaders for popular game formats
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg4.htm


#3

The faster way could be to use the Flexporter Plugin, but it is available only for Max5, so you would have to rebuild it for Max6 (I’m not sure, but i think the source is included).
http://www.codercorner.com/Flexporter.htm

cu
Tom


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.