~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/vision/camera/cam_aim.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 /**
  4 camera.c:
  5 general camera functions
  6 **/
  7 
  8 #include <tina/sys.h>
  9 #include <tina/math.h>
 10 #include <tina/mathfuncs.h>
 11 #include <tina/vision.h>
 12 #include <tina/visionfuncs.h>
 13 
 14 /**
 15 transformation to the coordinate system standing
 16 at point p,
 17 z-axis along aim
 18 y-axis in plane of aim and down
 19 **/
 20 
 21 Transform3 trans3_from_aim(Vec3 p, Vec3 aim, Vec3 down)
 22 {
 23     Vec3    ex = {Vec3_id};
 24     Vec3    ey = {Vec3_id};
 25     Vec3    ez = {Vec3_id};
 26 
 27     vec3_basis(aim, down, &ex, &ey, &ez);
 28     return (trans3_to_frame(p, ex, ey, ez));
 29 }
 30 
 31 /**
 32 camera with position and orientation specified as above
 33 
 34 Note:
 35 
 36 get simplest camera model
 37     type = 0
 38     f = ax = ay = 1.0;
 39     width = height = 1;
 40     cx = cy = 0.0;
 41     pix = 1.0;
 42 
 43 can get more realistic, centred camera with given field of view using
 44     type = 0
 45     f = ax = ay = 1.0;
 46     width = height (e.g. 256.0 or 512.0)
 47     cx = cy = width/2.0
 48     pix = (2.0/width)*tan(theta*DEGREE/2.0) (theta = field of view in degrees)
 49 
 50 standard Tina camera has position and orientation
 51     p = vec3_zero()
 52     aim = vec3_ez()
 53     down = vec3_ey()
 54 **/
 55 
 56 Camera *cam_from_aim(unsigned int type, Vec3 p, Vec3 aim, Vec3 down, double f, double pix, double ax, double ay, double cx, double cy, int width, int height)
 57 {
 58     Transform3 transf = {Transform3_id};
 59 
 60     transf = trans3_from_aim(p, aim, down);
 61 
 62     return (cam_make(type, &transf, f, pix, ax, ay, cx, cy, width, height));
 63 }
 64 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.