|
From: <luc...@li...> - 2001-10-24 15:07:33
|
Substituting the implementation of rot in ViewerOpengl.cpp with the
following one:
///////////////////////////////////////////////////////////////////////
void
ViewerOpenGL::rot(float x, float y, float z, float a)
{
float rot_quat[4];
float vec[3];
vec[0]=3Dx;
vec[1]=3Dy;
vec[2]=3Dz;
// normalizing vector
int i;
float module;
module =3D (vec[0]*vec[0] + vec[1]*vec[1]+vec[2]*vec[2] );
module=3Dsqrt(module);
for (i =3D 0; i < 3; i++) vec[i] /=3D module;
// computing quaternion
float q=3Dsin(a*0.01/2);
rot_quat[0]=3D vec[0]*q;
rot_quat[1]=3D vec[1]*q;
rot_quat[2]=3D vec[2]*q;
rot_quat[3]=3Dcos(a*0.01/2);
add_quats(rot_quat,d_curquat,d_curquat);
d_rotationChanged=3Dtrue;
wsPostRedraw();
}
//////////////////////////////////////////////////////////////////////
will solve issue number 1. as described in the bug report regarding
Navigation submitted by Greg Roelofs.
I can work to improve the navigation interface.
It would be useful if i can get in touch with Greg or with someone else
to discuss possible improvements.
Luca
|