-
Notifications
You must be signed in to change notification settings - Fork 1
Camera
k10forgotten edited this page Nov 30, 2012
·
4 revisions
Defines all the information needed to the camera.
typedef struct {
Point lookFrom;
Point lookAt;
Point up;
GLdouble near;
GLdouble far;
GLdouble fovY;
} Camera;
- lookFrom: The Point where the camera is.
- lookAt: The Point where the camera is looking.
- up: The Point defining the camera's up vector.
Camera myCamera = newCamera(0,0,2, 0,0,0, 0,1,0, 1,300,30);
This method fills the struct. You need to pass each Point (x,y,z) value (lookFrom, lookAt and up, respectively), near, far and vertical field of view angle, in this order.
RayCaster myRayCaster = newRayCaster(myCamera);
This method fills all fields of the RayCaster. It needs a Camera as parameter since it uses gluLookAt and gluPerspective to get the correct ModelView and Projection matrices.