glVertex3f??!

Started by
20 comments, last by Noxir 18 years, 6 months ago
Could anyone explain how glVertex3f(x,y,z) works? I don't get it. How I know which point I'm editing? [edit] I'm MAKING? [Edited by - Noxir on October 22, 2005 7:12:29 PM]
Advertisement
There is no such thing as "editing" points in OpenGL. OpenGL is not a scene graph library; it does not keep track of any geometry. OpenGL does one thing and one thing only: It draws where you tell it to draw. The glVertex passes a vertex to OpenGL to be drawn; it doesn't edit anything. Next frame, if you still want the vertex to be visible, you have to call glVertex again.
Quote:Original post by Noxir
Could anyone explain how glVertex3f(x,y,z) works? I don't get it. How I know which point I'm editing?


i think you have a few more problems if you dont know which point you're editing, because i certainly don't.

ok, most 3d models are stord in a file somewhere, and comprise of many many float variables.

for simplicity, you could load them into a bit array and do this
(havent used openGL in a while, so names are a bit iffy )
glBegin( GL_TRIANGLES );for( int i = 0 ; i < array_size ; ++i ){   glVertex3f( vertices[X], vertices[Y], vertices[Z] );}glEnd();

better answers please, you're talking to an OpenGL beginner not albert einstein
Quote:Original post by Noxir
better answers please, you're talking to an OpenGL beginner not albert einstein

Uh huh. Based on your posting history, it looks like (a) you are a beginner, and (b) you think you're Albert Einstein. You need to take things slower, and get more of an idea of the fundamentals of what you're doing. I'm not sure how to give you a better answer than "OpenGL only draws things", but I AM sure that you aren't going to get anywhere unless you spend some more time reading. Buy this book and start reading it. Also, this stuff will go a hell of a lot easier for you if you spend some time learning linear algebra. Not the really complicated stuff... just vectors and matrices.
Alright, you're probably familiar with easier development tools. With glVertex3f(), your not acessing a vertex. You're not modifying one. Your not deleting one. What you are doing is telling OpenGL to plot a vertex at the x,y, and z coordinate you pass to the function. OpenGL doesn't store your verticies for you, it justs displays things on the screen. So if you want to store verticies, you'll have to make your own data system to do that, and then pass the data to the glVertex3f() function to display it on the screen.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
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.

Quote:Original post by Sneftel
Quote:Original post by Noxir
better answers please, you're talking to an OpenGL beginner not albert einstein

Uh huh. Based on your posting history, it looks like (a) you are a beginner, and (b) you think you're Albert Einstein. You need to take things slower, and get more of an idea of the fundamentals of what you're doing. I'm not sure how to give you a better answer than "OpenGL only draws things", but I AM sure that you aren't going to get anywhere unless you spend some more time reading. Buy this book and start reading it. Also, this stuff will go a hell of a lot easier for you if you spend some time learning linear algebra. Not the really complicated stuff... just vectors and matrices.


I've tried learning how the fuck Vertex3f works for hours now and I still don't get it. About the book, I can't afford it, and won't be able to afford it for a long while. I just wanted someone to explain, how it works, instead of correcting my question with "It isn't editing, it's making".
And this is nothing about what's based on my posting history, ass.

Noobyesthxbye
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?
Quote:Original post by Noxir

Sure, new question: How I know which position of a vertex I'm giving?


The x y z of glVertex3f(x,y,z). I doubt that's the answer you wanted. But your giving really general questions, that require us to know how you think opengl works. Or in other words, you have an idea of how opengl works. Like in your first question you assumed that there was a bunch of points you moved around (which isn't the case). And now your asking us questions about how you think opengl works, but we have no idea how it works in your head.

You might try asking more specific questions about opengl. Like how to draw a triangle, or how does the 3d position of x,y,z become a point on the screen.

This topic is closed to new replies.

Advertisement