c3camera: Added a field-of-view
authorMichel Pollet <buserror@gmail.com>
Sat, 16 Jun 2012 08:08:25 +0000 (09:08 +0100)
committerMichel Pollet <buserror@gmail.com>
Sat, 16 Jun 2012 08:08:25 +0000 (09:08 +0100)
For calculating perspective matrix

examples/shared/libc3/src/c3camera.c
examples/shared/libc3/src/c3camera.h

index f4eef0f..a4e6257 100644 (file)
@@ -334,7 +334,7 @@ c3cam_reset(
     c->up = c3vec3f( 0.0, 1.0, 0.0 );
     c->eye = c3vec3f(0.0, 0.0, 10.0);
     c->lookat = c3vec3f(0.0,0.0,0.0);
-
+    c->fov = 50.0f;
     c->mtx = identity3D();
 
     c3cam_update(c);
index 5f47af7..a189f9d 100644 (file)
@@ -30,6 +30,7 @@ typedef struct c3cam_t {
        c3vec3 up, side, forward;
        c3mat4 mtx;
        c3f distance;
+       c3f fov;
 } c3cam_t, *c3cam_p;
 
 /******************************* set_distance() ***********/