123 modelview_matrix.
swap(other.modelview_matrix);
124 projection_matrix.
swap(other.projection_matrix);
125 swap(near, other.near);
126 swap(far, other.far);
166 return projection_matrix;
219 modelview_matrix(row, col) = value;
225 projection_matrix(row, col) = value;
231 return modelview_matrix(row, col);
237 return modelview_matrix(row, col);
243 return projection_matrix(row, col);
249 return projection_matrix(row, col);
302 camera_center_in_world_coordinates.
swap(other.camera_center_in_world_coordinates);
307 void set_focal_length(
double focal_length,
double skew,
double aspect_ratio);
309 void set_aspect_ratio(
double aspect_ratio,
double focal_length,
double skew);
311 void set_skew(
double skew,
double aspect_ratio,
double focal_length);
380 unsigned int num_rows,
381 unsigned int num_cols
389 void set_rotation_matrix(
const kjb::Matrix & rotation_matrix);
392 void translate(
double dx,
double dy,
double dz);
395 void set_rotations_and_translate(
double pitch,
double yaw,
double roll,
double dx,
double dy,
double dz);
401 Vector camera_center_in_world_coordinates;
Base_gl_interface(double inear=10, double ifar=10000)
Definition: gr_camera.cpp:93
void set_projection_matrix(const Matrix &pm)
sets the projection matrix
void set_focal_no_skew(double focal_length, double aspect_ratio)
sets the focal length assuming no skew
Definition: gr_camera.cpp:940
Matrix get_gl_projection_matrix() const
returns the exact matrix that opengl uses for its projection matrix. this is effectively glOrtho(-vp_...
Definition: gr_camera.cpp:252
static void set_gl_viewport(double x, double y, double w, double h)
sets all the gl viewport parameters (x,y,width,length)
Definition: gr_camera.cpp:371
void set_camera_center(const kjb::Vector ¢er)
Sets the position of the camera center.
Definition: gr_camera.cpp:992
Definition for the Matrix class, a thin wrapper on the KJB Matrix struct and its related functionalit...
void transform_point_to_camera_frame(kjb::Vector &point) const
Transform a point from the world coordinate system to the camera coordinate system.
Definition: gr_camera.cpp:1162
void set_aspect_ratio(double aspect_ratio, double focal_length, double skew)
sets the aspect ratio
Definition: gr_camera.cpp:912
Definition: gr_camera.h:288
bool Polygon_visibility_test(const kjb::Polygon &p, double epsilon=0) const
Definition: gr_camera.cpp:1218
void set_skew(double skew, double aspect_ratio, double focal_length)
sets the skew
Definition: gr_camera.cpp:925
This class implements matrices, in the linear-algebra sense, restricted to integer-valued elements...
Definition: l_int_matrix.h:71
double get_projection_entry(unsigned int row, unsigned int col) const
returns an entry of the projection matrix
Definition: gr_camera.h:247
void set_principal_point(double px, double py)
sets both coordinates of the principal point
Definition: gr_camera.h:318
void scale_modelview(double xscale, double yscale, double zscale)
scales the modelview matrix using glScale
Definition: gr_camera.cpp:747
virtual ~Base_gl_interface()
Definition: gr_camera.h:111
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
virtual void swap(Self &other)
Definition: gr_camera.h:298
const Matrix & get_projection_matrix() const
returns the projection matrix; note: this needs to be preceeded by a glOrtho call with the window dim...
Definition: gr_camera.h:164
void set_world_origin(const kjb::Vector ¢er)
Sets the world origin in camera coordinates (the "t" vector in Forsyth)
Definition: gr_camera.cpp:1029
virtual void swap(Self &other)
Definition: gr_camera.h:119
virtual Base_gl_interface & operator=(const Base_gl_interface &src)
bgl the Base_gl_interface to assign to this one
Definition: gr_camera.cpp:180
virtual void set_gl_modelview() const
Sets the gl modelview matrix based on the current camera parameters.
Definition: gr_camera.cpp:707
REAL * point
Definition: triangle.c:537
double get_far() const
gets the far clipping plane distance from the camera
Definition: gr_camera.h:159
void set_world_scale(double xscale, double yscale, double zscale)
Sets the world scale along the three major axes using glScaled.
Definition: gr_camera.h:351
void set_rotation_angles(double pitch, double yaw, double roll)
Sets the rotation angles of this camera.
Definition: gr_camera.cpp:1096
x
Definition: APPgetLargeConnectedEdges.m:100
double get_modelview_entry(unsigned int row, unsigned int col) const
returns an entry of the modelview matrix
Definition: gr_camera.h:235
static void get_gl_viewport_size(double *w, double *h)
gets the gl viewport width and height
Definition: gr_camera.cpp:315
static double get_gl_viewport_width()
returns the gl viewport width
Definition: gr_camera.cpp:288
virtual ~Parametric_camera_gl_interface()
Definition: gr_camera.h:296
virtual void set_gl_projection() const
Sets the gl projection matrix based on the current camera parameters.
Definition: gr_camera.cpp:674
void set_far_clipping_plane(double ifar)
sets the far clipping plane distance from the camera
Definition: gr_camera.cpp:214
Parametric_camera_gl_interface(double inear=10, double ifar=10000)
Definition: gr_camera.cpp:838
Definition: gr_polygon.h:36
virtual Parametric_camera_gl_interface & operator=(const Parametric_camera_gl_interface &src)
Definition: gr_camera.cpp:857
float ** matrix(long nrl, long nrh, long ncl, long nch)
Definition: nr.cpp:76
void set_intrinsic_parameters(double focal_length, double aspect_ratio, double skew, double px, double py)
sets all the intrinsic parameters of the camera
Definition: gr_camera.cpp:982
void set_principal_point_y(double py)
sets the y coordinate of the principal point
Definition: gr_camera.cpp:884
const Matrix & get_modelview_matrix() const
returns the gl modelview matrix
Definition: gr_camera.h:162
void swap(kjb::Gsl_Multimin_fdf &m1, kjb::Gsl_Multimin_fdf &m2)
Swap two wrapped multimin objects.
Definition: gsl_multimin.h:693
REAL epsilon
Definition: triangle.c:674
void set_clipping_planes(double inear, double ifar)
sets the near and far clipping plane distances from the camera
Definition: gr_camera.cpp:232
double & get_modelview_entry(unsigned int row, unsigned int col)
returns an entry of the modelview matrix
Definition: gr_camera.h:229
virtual void mult_gl_projection() const
Multiplies the current gl projection matrix with this camera's matrix.
Definition: gr_camera.cpp:687
Definition: gr_camera.h:103
void set_modelview_matrix(const Matrix &mv)
sets the modelview matrix
void set_modelview_entry(unsigned int row, unsigned int col, double value)
sets an entry of the modelview matrix
Definition: gr_camera.h:217
static double get_gl_viewport_height()
returns the gl viewport height
Definition: gr_camera.cpp:302
static double get_gl_viewport_aspect()
returns the ratio between the gl viewport width and the gl viewport height
Definition: gr_camera.cpp:274
void swap(Vector &other)
Swap the representations of two vectors.
Definition: m_vector.h:884
static void capture_gl_view(kjb_c::KJB_image **img_out)
captures the gl view and stores it into a KJB_image
Definition: gr_camera.cpp:386
static void construct_image_from_int_matrix(kjb::Image &im, kjb::Int_matrix &m)
Definition: gr_camera.cpp:556
void set_near_clipping_plane(double inear)
sets the near clipping plane distance from the camera
Definition: gr_camera.cpp:192
static void set_gl_viewport_size(double, double)
sets the gl viewport size
Definition: gr_camera.cpp:353
bool is_point_in_camera_frustum(const kjb::Vector &point_in_world_coordinates, double &ox, double &oy, unsigned int num_rows, unsigned int num_cols) const
Given a point in world coordinates, it returns true if the point is in the viewing frustum...
Definition: gr_camera.cpp:1244
This class implements matrices, in the linear-algebra sense, with real-valued elements.
Definition: m_matrix.h:94
void set_focal_no_aspect_ratio(double focal_length, double skew)
sets the focal length assuming aspect_ratio=1
Definition: gr_camera.cpp:956
void project_point(double &x, double &y, double &z, const kjb::Vector &point3D, double img_height) const
Definition: gr_camera.cpp:761
for m
Definition: APPgetLargeConnectedEdges.m:64
virtual void swap(Self &other)
Definition: gr_rigid_object.h:107
void set_principal_point_x(double px)
sets the x coordinate of the principal point
Definition: gr_camera.cpp:876
void set_focal_no_aspect_ratio_no_skew(double focal_length)
sets the focal length assuming aspect_ratio=1 and no skew
Definition: gr_camera.cpp:968
static void get_gl_viewport(double *x, double *y, double *w, double *h)
gets all the g; viewport parameters (x,y,width,height)
Definition: gr_camera.cpp:334
Wrapped version of the C struct KJB_image.
Definition: i_image.h:76
virtual Parametric_camera_gl_interface * clone() const
Definition: gr_camera.cpp:868
void swap(Matrix &other)
Swap the representations of two matrices.
Definition: m_matrix.h:532
Definition: gr_rigid_object.h:87
double & get_projection_entry(unsigned int row, unsigned int col)
returns an entry of the projection matrix
Definition: gr_camera.h:241
void set_projection_entry(unsigned int row, unsigned int col, double value)
sets an entry of the projection matrix
Definition: gr_camera.h:223
virtual bool Polygon_visibility_test(const kjb::Polygon &p, double epsilon=0) const
checks whether a given polygon is visible under the given camera parameters
Definition: gr_camera.cpp:818
void prepare_for_rendering(bool clean_buffers) const
Prepares the opengl for rendering by setting the gl modelview and projection matrix based on the curr...
Definition: gr_camera.cpp:726
static void set_gl_view(const kjb::Image &img_in)
Definition: gr_camera.cpp:627
void get_point_in_world_coordinates(const kjb::Vector &point_in_camera_coordinates, kjb::Vector &point_in_world_coordinates) const
Transforms a point in camera coordinates to world coordinates.
Definition: gr_camera.cpp:1191
double get_near() const
gets the near clipping plane distance from the camera
Definition: gr_camera.h:156
void set_focal_length(double focal_length, double skew, double aspect_ratio)
sets the focal length
Definition: gr_camera.cpp:897
void rotate_point_to_camera_frame(kjb::Vector &point) const
Rotates a point from the world coordinate system to the camera coordinate system. ...
Definition: gr_camera.cpp:1179