Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bdenboer

Creating object in OpenGL

This topic is 6495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, Can anyone tell me how to create or model objects that can be placed in an OpenGL scene? I have several modelling tools/programs like 3dstudio and lightwave but I have no idea how to export them to an OpenGL format. I do have the utility 3DWin and it can export lightwave and 3dstudio formats to CPP files. But these files consist of about 10,000 lines of code for a relatively simple object. So my question is: Is there a way to import 3DS/LWO/OBJ files directly into OpenGL code?? How do game designers handle these objects? Thanks! BRam.

Share this post


Link to post
Share on other sites
Advertisement
Hey there. There are probably many ways you could do it.

The way I eventually figured out to do it was to export a model from 3D MAX as an .ase file. (ASCII).
This file has all the data you could need and all you need to do is write a bit of code to parse it into opengl statements.

Good luck

Cel

Share this post


Link to post
Share on other sites
Yeah, but how do you handle all the diff. surfaces and textures?
It would be great if there was a way to include a complete object file.

But anyway, thanks for your suggestion. At least I know now that there isn''t only one proper way.

Is it hard to make an ASE parser, because I''m an absolute beginner at OpenGL and I''d like to quickly add objects to my scene.

Greetz
Bram

Share this post


Link to post
Share on other sites
hi... check nate miller''s page ... I forgot the url but nehe''s got the link on his page ... there''s ase demo ... shows how to handle - you can create your own format out of it (binary ofcoz!)

Pet

Share this post


Link to post
Share on other sites
hi

quote:
Original post by Pet
and there''s no easy way...

there is an easy way. Let''s go to www.xdsoft.com. There is a cool app named 3Dexploration. It can export .3DS data to OGL display list.

lunasol

Share this post


Link to post
Share on other sites
Isn''t Direct3D programming alot easier then? As far as I know, you can include complete *.X objects in Direct3D.

Another question:

I can''t figure out how to draw an object generated by 3dexploration on screen. The cpp file it generates has a function called Gen3DObjectList() but how exactly do I use it?

Share this post


Link to post
Share on other sites
Well no, .x files are only loaded for you in D3D rentained mode - nobody really uses that.

I''m not sure Nate''s loader handles all material parameters - do take a look at his page though.

I''ve got a similar object loader on my site, but it loads Milkshape object files...

Paul Groves
pauls opengl page
paul's opengl message board

Share this post


Link to post
Share on other sites
i havent used the program before so im not 100% sure but i think maybe
do this once
GLint mylist = Gen3DObjectList();

and then when u want to draw the object go glCallList(mylist);

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!