Jump to content
  • Advertisement
Sign in to follow this  
Noxir

glVertex3f??!

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

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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();


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!