[vtkusers] how to know image scale from camera distance....
amay.ms at gmail.com
Wed Jan 14 04:42:09 EST 2015
I have a large 2D image. To show it initially, I set the camera distance and
focal point such that the image appears fit to screen. I do this as below:
double centerX = imageWidth/2.0;
double centerY = imageHeight/2.0
camera.setFocalPoint( centerX , centerY, 0);
double angle = math.RadiansFromDegrees( camera.GetViewAngle() );
double distance = Math.max(centerX, centerY)/ Math.tan( angle * 0.5 );
camera.setPosition( centerX, centerY, distance);
This shows the image correctly fit to screen.
Now I have to display the scale of the image. So, I want to calculate the
currently visible image scale based on the distance of the camera.
Can you help me how to determine it?
Thanks a lot for your help,
View this message in context: http://vtk.1045678.n5.nabble.com/how-to-know-image-scale-from-camera-distance-tp5730113.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers