PDA

View Full Version : Modeling



04-26-2004, 04:29 PM
If i have a good model , how can i create it with
opengl ?
I practiced some simple model with
glBegin(GL_TRIANGLES)

glEnd()
but it is too difficult for complicated model ,
any good idea?

nexusone
04-26-2004, 04:40 PM
For complex models you use a 3D modeler/editor program(CAD), then load in the file created by the program into openGL.

You could use a 3D modelers that edits Quake models and worlds, and then load that data into your program.

Lots of example on how to load quake models into a openGL program.


Originally posted by <Turn right>:
If i have a good model , how can i create it with
opengl ?
I practiced some simple model with
glBegin(GL_TRIANGLES)

glEnd()
but it is too difficult for complicated model ,
any good idea?

04-26-2004, 05:04 PM
Maybe i didnt tell what i want to say

What i dont know is how to load a complex model
in a simple way instead of vertex by vertex.

nexusone
04-26-2004, 05:15 PM
Loading it vertex by vertex is the most simple way, another would be to use someone elses model loading routine.


Originally posted by <Turn right>:
Maybe i didnt tell what i want to say

What i dont know is how to load a complex model
in a simple way instead of vertex by vertex.

ZbuffeR
04-27-2004, 12:47 AM
Originally posted by <Turn right>:
What i dont know is how to load a complex model
in a simple way instead of vertex by vertex.By 'load' you mean send it to the card maybe ? So try to search about vertex arrays or VBO (the extension name is GL_ARB_vertex_buffer_object). I am not too experienced with that.

But using immediate mode (vertex by vertex) is not so bad to start with. You can do that with display lists, and data will stay on the card.

Aeluned
04-27-2004, 04:54 AM
attempting to create a complex 3D model in OpenGL by plotting vertex after vertex is masochistic.

as nex suggested before, the easiest way is to create your model in a 3D modeling studio (3D SMax, etc...) and then parse the file and load the data into structures in your program.

you could create arrays for your vertices and read the vertex data from the file into your arrays. After that you could pass these vertex arrays to OpenGL and batch render them.

this is the simplest and fastest way to render complex 3d geometry in OpenGL (as far as I'm aware anyway).

Turn right
04-27-2004, 03:48 PM
Thanks , your help is appreciated!

04-28-2004, 09:45 AM
Hey!

There is a plugin for 3DS Max that can export a
*.cpp file containing functions like
void DrawShape01()
{
glBegin(...);
glVertex(...);
glVertex(...);
.
.
.
glEnd();
}

it is called glexport.dle and you can find it on the net (it's free)
just copy it into the <stdplugs> folder

Aeluned
04-28-2004, 10:53 AM
If it's calling glVertex* the implementation is a crude one. While this makes your life easier, expect your rendering times to suffer in the presence of high polygon count models.

For complex geometry you really want to use Vertex Arrays or VBOs.