Jump to content
  • Advertisement

Archived

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

MrSandman666

OpenGL using models in OpenGL (CAUTION! NEWBIE INSIDE!)

This topic is 6463 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

Ok, this is probably very basic and stupid but I''m a pretty stupid newbie (especially in the field of 3d graphics and OpenGL) so please bear with me. In my program I need to handle more or less complex models. Well, they are far too complex to hardcode every single polygon by hand. So how do i get models into my program? I don''t have a 3D modeler right now and I''m not a great 3D artist. So what would you recommend for me? How could I create my models, how should I store them in a file? How would I load them again (this one is probably pretty straight forward. I just have to do the storing process the other way ''round) and how should I display ''em then? How do you handle models? Or how would you handle models if you had to? So many questions and all I have is an empty brain. Please help a desperate newbie out. There was a time where you were newbies too and needed help like I do right now. ANY input is more than welcome. Thanx for reading till here. And pleeeeeaaze help me if you can. "Mr Sandman bring me a dream"

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by MrSandman666

In my program I need to handle more or less complex models. Well, they are far too complex to hardcode every single polygon by hand.

So how do i get models into my program? I don''t have a 3D modeler right now and I''m not a great 3D artist. So what would you recommend for me?



You can use 3D studio (max) to create your models or another modeling package.

quote:
How could I create my models, how should I store them in a file? How would I load them again (this one is probably pretty straight forward. I just have to do the storing process the other way ''round) and how should I display ''em then?

How do you handle models? Or how would you handle models if you had to?


Best to save in 3DS format or just the standard file from that modeller. There are a lot of conversion tools out there to convert the modeller file, to C(++) or a simple AscII format or binary or whatever. If this conversion still isn''t good enough, I would recommend converting to simple AscII and writing your own convertor.

To display them, might not be so easy if you haven''t written any OGL or D3D program yet. If you''re new at this - I would suggest a visit to nehe.gamedev.net for source code and tutorials and www.opengl.org for the SDK.

Share this post


Link to post
Share on other sites
3D STUDIO MAX??? *cough*
I''m not rich for crying out loud! I''m only a hobby programmer.
Still, that''s not the main reason for me not to use some expensive modelling kit. I know there are even freeware ones out there.
I would just like to have my own file format to keep things simple. It is usually pretty hard (I think) to convert a 3d file (*.3ds for example) to something that works with OpenGL.
I mean, if someone knows a very simple and plain 3d file format out there or I find one, I''ll be very happy to have a look and try my luck with it, but 3ds is definately too complicated for me (I already had a look at it and didn''t understand a word).
I thought of having a list of vertices, each with position data and a material attached to it.
From that I can calculate the single polygons (which will be pretty hard though) and the normals from these polys.
The polygons can be rendered pretty easily then.

The problem is, where do I get the vertices from, how do I store them in a file so that they can be read easily later and how do I create polygons from these vertices.
Another problem for me would be the internal storage of the vertices and polygons. You''ll never know the nmber of verices or polys in a model in beforehand so the intuitive approach for me would be a linked list, but wouldn''t that be incredibly slow to read later? A dynamicaly declared array could be a solution.

BTW: I''m new to OpenGL, but that doesn''t mean that I have no experience at all with it. I''m just learning it at the moment, so i know the basic theories of rendering triangels, moving and lighting them and this kind of stuff. I havent mastered texture mapping yet, though.
Ohhhh, sh...! Texture mapping! I didn''t think about that one! If my model is defined by vertices initialy, how the hell would I specify the textures for them??? Ok, probably I have to store polys right away. So, where do I get poly''s from?
Oh my... Questions over questions. WHy does 3d have to be so hard

Anyways:
Thank you very much for your reply! I apologize if my answer sounded somehow rude or so. That just happens to me sometimes.
I really appreciated your help

"Mr Sandman bring me a dream"

Share this post


Link to post
Share on other sites
a nice one is md2 files (plenty of character models around for code to load a md2 check the milkshake site)
"3d exportation"? converts various 3d file formats
milkshake + blender r modelling apps

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
this has a bunch of 3d editers. Should help you out. I use Strata 3d(free version), export me objects in vrml2 format then convert them to truespace files...

Share this post


Link to post
Share on other sites
Pauly, on your site you said that vertex arrays are somewhat fasionable and that they have certain advantages compared to display lists.
I''ve never heard of vertex arrays though. Wouldn''t display lists be faster? What are the advantages of vertex arrays?

"Mr Sandman bring me a dream"

Share this post


Link to post
Share on other sites
I would say, download Milkshape 3D. On the millshape site there are some links to tutorials on how to model and how to use the program. Its shareware so it works normal for 30 days, after that it will not save or export. The cost to register is only $20. If you can''t afford 3d studio max, im sure you can afford this one.

-Snyper

Share this post


Link to post
Share on other sites
In fact, I already DID download Milkshape. And the SDK and the avi tutorials. I haven''t registered it yet, but I guess I will do so soon. In my opinion it''s a really cool program.
But that doesn''t help me with my vertex array question. can anyone help me with that?

"Mr Sandman bring me a dream"

Share this post


Link to post
Share on other sites
Data in display lists is static. You can''t change it after you''ve compiled the display list without recompiling the display list again.

Vertex arrays let you render primitives with indices (reducing geometry bandwidth) and if you use copmiled vertex arrays and the proper datatypes, they can be as fast as display lists. The bonus is they aren''t static so you can change the data in them if needs be.

Thats just a primer, there''s loads of stuff been written about the pros and cons on graphics message boards all over the place.

Paul.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!