Conversation
add some debug
add frustum to replay debug
this wasn't supposed to be this way
|
unhappy windows test case: |
|
vtk Camera Elevation + Azimuth (and Roll, which are are not using) need void Camera::Roll(vtkm::Float32 angleDegrees)
{
vtkm::Vec3f_32 directionOfProjection = this->GetLookAt() - this->GetPosition();
vtkm::Matrix<vtkm::Float32, 4, 4> rotateTransform =
vtkm::Transform3DRotate(angleDegrees, directionOfProjection);
this->SetViewUp(vtkm::Transform3DVector(rotateTransform, this->GetViewUp()));
}
void Camera::Azimuth(vtkm::Float32 angleDegrees)
{
// Translate to the focal point (LookAt), rotate about view up, and
// translate back again.
vtkm::Matrix<vtkm::Float32, 4, 4> transform = vtkm::Transform3DTranslate(this->GetLookAt());
transform =
vtkm::MatrixMultiply(transform, vtkm::Transform3DRotate(angleDegrees, this->GetViewUp()));
transform = vtkm::MatrixMultiply(transform, vtkm::Transform3DTranslate(-this->GetLookAt()));
this->SetPosition(vtkm::Transform3DPoint(transform, this->GetPosition()));
}
void Camera::Elevation(vtkm::Float32 angleDegrees)
{
vtkm::Vec3f_32 axisOfRotation =
vtkm::Cross(this->GetPosition() - this->GetLookAt(), this->GetViewUp());
// Translate to the focal point (LookAt), rotate about the defined axis,
// and translate back again.
vtkm::Matrix<vtkm::Float32, 4, 4> transform = vtkm::Transform3DTranslate(this->GetLookAt());
transform =
vtkm::MatrixMultiply(transform, vtkm::Transform3DRotate(angleDegrees, axisOfRotation));
transform = vtkm::MatrixMultiply(transform, vtkm::Transform3DTranslate(-this->GetLookAt()));
this->SetPosition(vtkm::Transform3DPoint(transform, this->GetPosition()));
}Zoom is independent of pos, lookat, and up: Given this, it seems that |
Actually, we're fine not setting pos, lookat, or up until after since those will already be set with the default. But if we change 'up' before we change elevation (i.e. a new pos), then we get a bogus camera: #1546 |
|
With these changes -- position is set before, but Maybe for the elevation case, we need logic that re-sets the up (again) after applied? |
|
Yes, the issue is vtk-m elevate does not adjust up, so we need to think about the right logic to smooth this out for ascent. |
the order we parse camera params matters