Using Models[.max/.mds/.3ds] in opengl

Started by
9 comments, last by Gage64 16 years, 9 months ago
Hi ... i following nehe for years but never get the time to work with opengl so deeply... well i have map & some human models in 3ds max... now how can i import them in opengl? i am using 3ds max 5,vc++ for opengl coding, & system configuration is...... windows xp,512mb ram,2.53 ghz processor,845 intel original motherboard .... if any more info any 1 need just ask....... & thnx for helping & replying ............. in advance.
Advertisement
I once downloaded some sample code that loaded a 3DS model into openGL...can't remember where though. But I got it by googling...
Either write an exporter in maxscript to export the models to your file format or write a runtime loader to convert .3DS to your game model format. You can find the 3DS file format specifications on www.wotsit.org

-me
Brothers brothers brothers ...

u'r suggesting a kid...plz describe a little more ... almost every word fly 12 inch above my head...

ok now i'm checking this site u gave me..........http://www.wotsit.org/

and i'v googlisez this max & opengl stuff lotz of times but couldn't get what i'm exactly looking for .. "any process or technique to import any type of model made in 3ds max to opengl" ......so any 1 can tell me about this i'll be gr8ful ..but till then i hav to try writing some script in max to get the expected extension which is recognizable by opengl ........as my brothers suggested..

and thnx for replying so fast ...now plz plz any 1 tell me any way else ...if there is.....
So any modeling program creates a binary file in some format or other that contains: vertices, indices, colors, textures, uv coordinates, bones, animations, etc (if you don't know what these terms mean then you need to learn that before trying to load a model).

If you don't know how to read/write binary files you also need to learn that before trying to load a model.

Anyway baring all that it's your job as the programmer of a graphics engine to decide how that information is represented at runtime so you can draw it. So what you need to do is create a runtime model format and write code that translates from the 3DS file (or whatever file you export out of max) into your runtime format.

The information on wotsit just describes the format of the binary 3DS file. i.e. which bytes are where and what they mean. Knowing that allows you to write a program to parse that file into something meaningful to your engine.

So i guess in order:

1) Learn how to read and write binary files
2) Learn how to draw hardcoded textured objects in openGL (read the relevant chapters in the OpenGL red book: http://fly.cc.fer.hr/~unreal/theredbook/
3) Attempt to load a model made in another program into your game

-me

p.s. how does a "kid" afford a $3,000.00 modeling program?
What is your goal? Writing a game? In that case, you're better off using a 3D engine - it'll save you a lot of time and headaches.

Anyway, OpenGL won't 'recognize' a model format. That's not it's job. It's a low-level API that allows you to tell your 3D card to render faces. You can't just tell it to render your model, you'll have to write code that loads this model and then tells OpenGL what faces to render, based on what it just loaded. OpenGL doesn't think on the level of models, it thinks in terms of vertices and faces.

EDIT: Heh, not fast enough... :P
Create-ivity - a game development blog Mouseover for more information.
Quote:Original post by Palidine
-me

p.s. how does a "kid" afford a $3,000.00 modeling program?


Maybe using a trial version yet I doubt it :(

[edit]
Hmm maybe it had a very long trial period
Quote:3ds max 5
brothers .........

u know it's india ...... & i'v got a network which is enough to download anything ... available in the internet .......but anyway i'v got max 6,7,8,9....etc etc... full version but i don't use them it increases the process load too much on my machine.


soo now my primary objective is ....

1) Learn how to read and write binary files
2) Learn how to draw hardcoded textured objects in openGL (read the relevant chapters in the OpenGL red book: http://fly.cc.fer.hr/~unreal/theredbook/
3) Attempt to load a model made in another program into your game

ok ...

and about a 3d engine i'v heard about torque engine....probably i'll be abl to find it in the network somewhere... :D

i'm on it....

thnx for the describing man ...thnx

i'll ask for help again if i'm stuck somewhere............
Quote:Original post by idk
brothers .........

u know it's india ...... & i'v got a network which is enough to download anything ... available in the internet .......but anyway i'v got max 6,7,8,9....etc etc... full version but i don't use them it increases the process load too much on my machine.


Yes, they were aware of how you probably pirated software. As a tip, discussion of piracy outside of the theory is a big no-no here.

Quote:Original post by idk
soo now my primary objective is ....

1) Learn how to read and write binary files
2) Learn how to draw hardcoded textured objects in openGL (read the relevant chapters in the OpenGL red book: http://fly.cc.fer.hr/~unreal/theredbook/
3) Attempt to load a model made in another program into your game

ok ...

That is a decent high level overview. You may want to spend more time developing command line applications and/or more basic opengl applications as you are clearly lacking a proper programming foundation. Up to you.

Quote:Original post by idk
and about a 3d engine i'v heard about torque engine....probably i'll be abl to find it in the network somewhere... :D

Again with the piracy thing.
dat's right ....i'm agreed with kordova ...no more pirecy talk..... :D

i'm reading the redbook of opengl right now...i hope i'll be a bit more expart

about openGl after finishing it...well let's see......

This topic is closed to new replies.

Advertisement