Fundamentals Part 1

Fundamentals Part 1 - Homogeneous Representation (cont) I I...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Homogeneous Representation (cont) n to go from ordinary to homogeneous coordinates u if the object is a point, append a 1 u if the object is a vector, append a 0 n to go from homogeneous to ordinary coordinates u if the object is a point, delete the 1 this rule will change later on u if the object is a vector, delete the 0 Points in OpenGL n OpenGL represents a point with a set of floating-point numbers called a vertex n to draw a group of points use GLfloat x0, y0, z0, x1, y1, z1, xn, yn, zn; // assign values to x0, y0, z0, etc. here // . .. glBegin(GL_POINTS); glVertex3f(x0, y0, z0); // point with coordinates (x0, y0, z0) glVertex3f(x1, y1, z1); // and so on… glVertex3f(xn, yn, zn); glEnd(); n every call to glVertex() sends a vertex down the geometry stage
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Points in OpenGL (cont) n many versions of glVertex() void glVertex3f(…) n number (here 3) indicates number of coordinates u can be 2, 3, or 4 n letter (here f) indicates data type u can be s GLshort iG L i n t fG L f l o a t d GLdouble n examples: glVertex2i(3, 4); glVertex3f(-1.0f, 2.0f, 3.5f);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course CSE 4431 taught by Professor Burton during the Winter '12 term at York University.

Page1 / 5

Fundamentals Part 1 - Homogeneous Representation (cont) I I...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online