Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Building camera in a
program
Aravindhan A
Final year CSE | SMIT
about.me/aravindhan
Why build camera?

To have finite control over camera movements,
we create and manipulate our own camera in a
program

C...
Camera functions
Cam.set(eye,look,up);
Cam.slide(-1,0,-2);
Cam.roll(30);
Cam.yaw(20);
Camera functions
setModelViewMatrix()
glMatrixMode(GL_PROJECTION)
GlLoadIdentity()
myKeyboard()
Model-view matrix

Position the camera

By default, camera is at origin, looking in –z dir

To “move the camera”, set up a modelview matrix...
LookAt function

Most 3D toolkits let you position the camera by setting
eyepoint, lookpoint, and up direction
 lookAt(X...
LookAt function

Other viewing APIs

Thank you!
Building a camera in a program | Computer Graphics
Upcoming SlideShare
Loading in …5
×

Building a camera in a program | Computer Graphics

1,342 views

Published on

Presentation on the topic 'Building Camera in a Program' in Computer Graphics.

Published in: Education
  • Be the first to comment

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!

×