[vtkusers] Getting box coordinates
Mario Rodriguez
biomates at telefonica.net
Mon Sep 6 04:27:54 EDT 2010
Hello,
I have a scene formed by several objects (some of them obtained from
translation and/or rotations) bounded by a box (vtkAppendPolyData +
vtkOutlineFilter). Then I draw the axes with the corresponding x-y-z
tics (vtkCamera + vtkCubeAxesActor2D). Everything works fine.
What I need is to set the camera parameters automatically from the
dimensions of the bounding box. Instead of writing explicitly something
as
vtkCamera camera
camera SetFocalPoint 2 3 3
camera SetPosition 15 15 15
camera SetViewUp 0 0 1
I need to set the focal point to the geometric center of the box and the
position coordinates at a certain distance from the scene. And the
question is: is it possible to get the x-y-z ranges of the complete
scene, and after some simple calculations pass the necessary values to
SetFocalPoint and SetPosition?
I haven't found any example solving this particular problem.
Sorry if this question is very basic, but I've started to make my first
steps into vtk some days ago and I am not very familiar with this
software.
--
Mario
More information about the vtkusers
mailing list