Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

OpenGL help?


  • Please log in to reply

#1
ReCuRsIoN

ReCuRsIoN

    Member

  • Member
  • PipPip
  • 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. :whistling:
  • 0

Advertisements


#2
alansm

alansm

    New Member

  • Member
  • Pip
  • 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

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP