8thlightu2

491 views

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
491
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide



  • Z goes negative away from the camera. This is the coordinates you start with before you have three transformations - the View, Model and Projection.
  • 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.
  • Models. This is what you’ll primarily be doing. Translate - then rotate! If you rotate first you are changing the coordinate system. You’ll move differently than you think.

    MODELVIEW:

    If you imagine the camera as an invisible object, there’s really no difference. No difference in moving camera in negative z, or moving the scene in positive z.

    By convention the initial transformation provides a frame of reference for all further transformations.
  • MODELVIEW

    Imagine the camera is an invisible object that you place first.
  • 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.


  • The identity matrix. Resets the matrices.
  • OpenGL Supports Matrix Stacks as well - you can push and pop if you like, useful if you’ve already calculated a bunch of transforms and don’t want to mess up.
  • Code time




  • 8thlightu2

    1. 1. Transformation Let’s move things around
    2. 2. 3D?
    3. 3. Eye
    4. 4. View
    5. 5. Projection
    6. 6. Transformations
    7. 7. Transformations are Cumulative
    8. 8. Matrix Stacks
    9. 9. Perspective
    10. 10. Remember • glOrtho • glPerspective • glViewport • GL_PROJECTION
    11. 11. Modelview
    12. 12. Remember • glTransformf • glRotatef • glScalef • Load the Identity!
    13. 13. 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.

    ×