Quote:Original post by Noxir
Quote:Original post by Lundek
Quote:Original post by Noxir
better answers please, you're talking to an OpenGL beginner not albert einstein
There are no better answers, because the question "How I know which point I'm editing?" doesn't make any sense. You're not editing anything, you're giving OpenGL the position of a vertex.
Take a look at this. I didn't bother to read much of it, but it looks like a reasonable introduction to drawing OpenGL primitives.
Sure, new question: How I know which position of a vertex I'm giving?
Did you read my first post? Ok, #1, get out of any mindset your in right now about OpenGL. If you don't know what a mindset is, then you shouldn't be doing game programming yet. Ok, OpenGL doesn't store verticies. It doesn't do anything in your engine except 2 things. The first thing it does is set the video settings for your application. The second thing you do is color the screen you provide it with. Follow this next part closely with this in mind.
Example:
We need to display a triangle on the screen. Now, the only way we can do this is to tell OpenGL we need it to color in a triangle on the screen. We tell it to start displaying triangles with glBegin(GL_TRIANGLES);. Now, for a triangle, there must be 3 verticies (points) to tell OpenGL the position of the triangle. But OpenGL doesn't contain any data on our verticies. A vertex has a x,y, and z coordinate describing its location. Let's make the coordinates for our 3 verticies (0,0,0),(1,0,0), and (0,1,0). So we pass to OpenGL the x,y, and z coordinates for each vertex with the glVertex3f(x,y,z); function.
glBegin(GL_TRIANGLE);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(1.0f,0.0f,0.0f);
glVertex3f(0.0f,1.0f,0,0f);
glEnd();
We have told OpenGL that we will create 3 verticies to form a triangle.
[Edited by - dbzprogrammer on October 23, 2005 8:08:19 PM]
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"