using models in OpenGL (CAUTION! NEWBIE INSIDE!)
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"
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.
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"
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"
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
"3d exportation"? converts various 3d file formats
milkshake + blender r modelling apps
http://members.xoom.com/myBollux
Theres a primer on loading simple objects on my site. Once you''ve done that, it goes on to provide code to load Milkshape 1.3 files.
Paul Groves
pauls opengl page
Paul Groves
pauls opengl page
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...
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"
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"
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
-Snyper
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"
But that doesn''t help me with my vertex array question. can anyone help me with that?
"Mr Sandman bring me a dream"
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement