http://www.chai3d.org/doc/classc_camera.html#6b5bbcc535b601c19e10be288dfc65f7
for
bool cCamera::set ( const cVector3d & a_localPosition,
const cVector3d & a_localLookAt,
const cVector3d & a_localUp
)
this call returns true that is success
camera->set( cVector3d (1, 0.0, 3), // camera position (eye)
cVector3d (0.0, 0.0, 0.0), // lookat position (target)
cVector3d (-1.0, 0.0, 0.0)); // direction of the "up" vector);
}
I dont get any errors, but this call returns false which is failure to set cameras new position, why?
camera->set( cVector3d(toolPos.x,toolPos.y,toolPos.z),
cVector3d(toolPos.x,toolPos.y,toolPos.z),
cVector3d (1.0, 0.0, 0.0));
tool is a cVector3d variable with valid values when I check using breakpoints….also
definition of cVector3d is
cVector3d (const double a_x, const double a_y, const double a_z)
Constructor by passing a doubles to initialize vector.
Well your first vector (camera position) and your second vector (lookat position) have the same values. The algorithm for setting the new position cannot figure out in which direction the camera is facing because there is no direction from
eyetolookAt. Just movelookat positionfrom theeyein the direction you want to look.