Successfully reported this slideshow.
Your SlideShare is downloading. ×

Building a camera in a program | Computer Graphics

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 11 Ad
Advertisement

More Related Content

Similar to Building a camera in a program | Computer Graphics (20)

Advertisement

Recently uploaded (20)

Building a camera in a program | Computer Graphics

  1. 1. Building camera in a program Aravindhan A Final year CSE | SMIT about.me/aravindhan
  2. 2. Why build camera?  To have finite control over camera movements, we create and manipulate our own camera in a program  Created through a camera class which can do all functions
  3. 3. Camera functions Cam.set(eye,look,up); Cam.slide(-1,0,-2); Cam.roll(30); Cam.yaw(20);
  4. 4. Camera functions setModelViewMatrix() glMatrixMode(GL_PROJECTION) GlLoadIdentity() myKeyboard()
  5. 5. Model-view matrix 
  6. 6. Position the camera  By default, camera is at origin, looking in –z dir  To “move the camera”, set up a modelview matrix that moves objects that are drawn  Ignore Z-coordinate when drawing
  7. 7. LookAt function  Most 3D toolkits let you position the camera by setting eyepoint, lookpoint, and up direction  lookAt(Xeye, Yeye, Zeye, Xat, Yat, Zat, Xup, Yup, Zup):  Effect: set the modelview matrix
  8. 8. LookAt function 
  9. 9. Other viewing APIs 
  10. 10. Thank you!

×