0 f 10 f 00 f glcolor4f 00 f 00 f 10 f 10 f

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: GL_TRIANGLES ) ; glColor4f (1.0 f ,1.0 f ,1.0 f ,1.0 f ) ; glVertex3d (.5 ,.25 ,0.0) ; glVertex3d (.25 ,.5 ,0.0) ; glVertex3d (.25 ,.25 ,0.0) ; glEnd () ; glBegin ( GL_LINES ) ; glColor3f (1.0 f ,0.0 f ,0.0 f ) ; glVertex3d (1.0 ,0.0 ,0.0) ; glColor3f (0.0 f ,1.0 f ,0.0 f ) ; glVertex3d (0.0 ,1.0 ,0.0) ; glColor3f (0.0 f ,1.0 f ,0.0 f ) ; glVertex3d (0.0 ,1.0 ,0.0) ; glColor3f (0.0 f ,0.0 f ,1.0 f ) ; glVertex3d (0.0 ,0.0 ,0.0) ; glColor3f (0.0 f ,0.0 f ,1.0 f ) ; glVertex3d (0.0 ,0.0 ,0.0) ; glColor3f (1.0 f ,0.0 f ,0.0 f ) ; glVertex3d (1.0 ,0.0 ,0.0) ; glEnd () ; Michael Tao CSC418: Computer Graphics Tutorial 1 September 20, 2012 23 / 31 Simple Example Michael Tao CSC418: Computer Graphics Tutorial 1 September 20, 2012 24 / 31 Transformations We want to traverse the scene and move scene objects around Use linear transformations in homogeneous coordinates: Fixed Pipeline maintains two matrices for you Switch between modifying them with glMatrixMode GL_MODELVIEW GL_PROJECTION http://www.songho.ca/opengl/gl_transform.html Michael Tao CSC418: Computer Graphics Tutorial 1 September 20, 2012 25 / 31 Transformations Michael Tao CSC418: Computer Graphics Tutorial 1 September 20, 2012 26 / 31 glMatrixM...
View Full Document

Ask a homework question - tutors are online