Like this presentation? Why not share!

# 8thlightu2

## on Jul 08, 2010

• 330 views

### Views

Total Views
330
Views on SlideShare
330
Embed Views
0

Likes
0
0
0

No embeds

### Report content

• Comment goes here.
Are you sure you want to
• <br />
• <br />
• <br />
• Z goes negative away from the camera. This is the coordinates you start with before you have three transformations - the View, Model and Projection. <br />
• View Transformation - represents the camera. You must specify the view transformation before any others, because all other transformations are relative to it. Typically at 0,0,0 going down the z axis. <br />
• Models. This is what you&#x2019;ll primarily be doing. Translate - then rotate! If you rotate first you are changing the coordinate system. You&#x2019;ll move differently than you think. <br /> <br /> MODELVIEW: <br /> <br /> If you imagine the camera as an invisible object, there&#x2019;s really no difference. No difference in moving camera in negative z, or moving the scene in positive z. <br /> <br /> By convention the initial transformation provides a frame of reference for all further transformations. <br />
• MODELVIEW <br /> <br /> Imagine the camera is an invisible object that you place first. <br />
• So each vertex you specify is represented, internally, as a 1x4 matrix. This is multiplied first by the ModelView matrix. That yields a transformed eye coordinate. That is then Multiplied by the Projection matrix. That gives you the coordinates before clipping. It gets clipped (perspective division) and finally transformed again to the viewport. Fortunately you only worry about the first two steps. <br />
• <br />
• <br />
• The identity matrix. Resets the matrices. <br />
• OpenGL Supports Matrix Stacks as well - you can push and pop if you like, useful if you&#x2019;ve already calculated a bunch of transforms and don&#x2019;t want to mess up. <br />
• Code time <br />
• <br />
• <br />
• <br />
• <br />

## 8thlightu2Presentation Transcript

• Transformation Let’s move things around
• 3D?
• Eye
• View
• Projection
• Transformations
• Transformations are Cumulative
• Matrix Stacks
• Perspective
• Remember • glOrtho • glPerspective • glViewport • GL_PROJECTION
• Modelview
• Remember • glTransformf • glRotatef • glScalef • Load the Identity!
• Homework • Take your model and render it using perspective projection. • Make more than one appear on the screen in different places, sizes, rotations. • Bonus points if you animate it.