[vtkusers] Positioning the Camera
Michael Györffy
4mg19 at qlink.queensu.ca
Thu May 2 13:25:11 EDT 2002
Hello:
My first problem is with a cutting plane/camera interaction. I'm
trying to slice up a
an object with two cuts a small distance apart. The normals for these
planes would be (0,0,1) and (0,0,-1). When I render using the negitive
cutting plan the camera looks in the wrong direction. Why is this?
Trying to reorient my sample, I could use some help
positioning the camera. I'm want to look
down the (0,0,1) direction but the camera is insisting on looking along
the (1,1,1) direction.
Any help on how to keep looking down the 0,0,1 direction would be
much apprecitated. I've included the Camera settings I'm experimenting
with.
Thank you,
Mike
Here is some script that I've been using to manipulating the camera with:
//Cam1->SetViewUp(0,1,0);
//Cam1->OrthogonalizeViewUp();
Cam1->ParallelProjectionOn();
Cam1->GetDirectionOfProjection(x,y,z);
printf("DirectionOfProjection %f %f %f \n", x,y,z);
// the default direction becomes 0.577*(1,1,-1) chosen by vtk
// I want this to be (0,0,-1)
//Cam1->ComputeViewPlaneNormal();
Cam1->SetPosition(0,0,cellsize);
Cam1->SetFocalPoint(cellsize/2,cellsize/2,(i+0.5)*increment);
Cam1->SetFocalPoint(cellsize/2,cellsize/2,cellsize/2);
if (acos(z/pow(x*x+y*y+z*z,(1/2)))!=0){
Cam1->Azimuth(-acos(z/pow(x*x+y*y+z*z,(1/2))));
Cam1->Elevation(-acos(z/pow(x*x+y*y+z*z,(1/2))));
}
Cam1->Yaw(0);
Cam1->Pitch(0);
Cam1->Dolly(0);
Cam1->Roll(0);
Cam1->Zoom(0.001);
Cam1->SetParallelScale(cellsize);
Cam1->SetClippingRange(0.00001, 1.5*cellsize);
//Cam1->ComputeViewPlaneNormal();
More information about the vtkusers
mailing list