Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

OpenGL help?

#1 ReCuRsIoN Posted 12 February 2007 - 07:18 PM

ReCuRsIoN

Member

• Member
• 20 posts
Hi guys,

Would be great if someone could help me understand the points on openGL. FOR example

glVertex3f(1.0, 1.0, 0.5) ---- stuff like this, what determines where my origin is going to be, and how do i know how far it will move. im a little confused with this. I understand where each one is going in terms of x, y, z coordinates, but i can never get a shape going that i want, really annoying!!

Thanks.
• 0

#2 alansm Posted 19 March 2007 - 06:51 PM

alansm

New Member

• Member
• 1 posts
glVertex commands are used within glBegin/glEnd pairs to specify point, line, and polygon vertices. The current color, normal, and texture coordinates are associated with the vertex when glVertex is called.
```glBegin(GL_QUADS);

glColor3f(1.0f, 0.0f, 0.0f);
// FRONT
glVertex3f(-0.5f, -0.5f,  0.5f);
glVertex3f( 0.5f, -0.5f,  0.5f);
glVertex3f( 0.5f,  0.5f,  0.5f);
glVertex3f(-0.5f,  0.5f,  0.5f);
// BACK
glVertex3f(-0.5f, -0.5f, -0.5f);
glVertex3f(-0.5f,  0.5f, -0.5f);
glVertex3f( 0.5f,  0.5f, -0.5f);
glVertex3f( 0.5f, -0.5f, -0.5f);

glColor3f(0.0f, 1.0f, 0.0f);
// LEFT
glVertex3f(-0.5f, -0.5f,  0.5f);
glVertex3f(-0.5f,  0.5f,  0.5f);
glVertex3f(-0.5f,  0.5f, -0.5f);
glVertex3f(-0.5f, -0.5f, -0.5f);
// RIGHT```

• 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users