AW: [vtkusers] rotating camera around focalpoint, how?

de Boer Ingo I.deBoer at polytec.de
Mon Aug 25 08:54:02 EDT 2003


> Is there a simple way to rotate the camera around the 
> focalpoint? When I use roll, pitch, yaw etc. the cam just 
> starts looking in another direction.
> (I do not want to rotate my data because then the x,y,z 
> coords will change right?)

shouldn't you use only then roll, elevation and azimuth ?
some thing like:

ViewCameraSetAngles(float fElevation, float fAzimuth, float fRoll)
{
 float *faAngles = m_pvtkCamera->GetOrientation();

 float fE = faAngles[0];
 float fA = faAngles[1];
 float fR = faAngles[2];

 m_pvtkCamera->Roll(-fR);
 m_pvtkCamera->Elevation(-fE);
 m_pvtkCamera->Azimuth(+fA);

 m_pvtkCamera->Elevation(fElevation);
 m_pvtkCamera->Azimuth(-fAzimuth);
 m_pvtkCamera->Roll(fRoll);

 m_pvtkCamera->Modified();
}

with this you can set absolut angles, because the function only
take angles to their current value.

greets
  Ingo



More information about the vtkusers mailing list