camera tuning

Brian Alexander Todd bat5 at po.cwru.edu
Mon Apr 10 14:12:55 EDT 2000


Robert,

I had to do exactly the same thing (I think).  I visualize
my 2D images by projecting them onto a plane.  I want the 
settings of the camera to such that the plane viewed by the 
camera would fill the window.  The method you should have 
a look at is vtkRenderer::ResetCamera()  This method almost 
does what you want but it always leaves a little space.  This
is due to a small factor multiplied onto the calculated camera distance
in ResetCamera.  What I did was to duplicate the ResetCamera 
code and then move the points of my bounding box toward the center 
by a compensating factor (I think it is 0.6) and call 
ResetCamera(float[6]) with the calculated bounds.  I can't mail the 
code right now because it is on my computer at home but I 
could mail it tomorrow.

Brian Todd

At 03:40 PM 4/10/00 +0200, Robert Riviere wrote:
>Hello,
>
>	I'm using the Renderer to display a flat 2D object.
>I'd like to tune the camera to make the object fill as much as 
>possible the rendering window.
>
>Unfortunately I haven't been able to do it. I've played with camera 
>SetPosition, SetParallelScale, SetDistance, ViewAngle etc...
>but I couldn't find a sequence to do it automatically.
>Hopefully it should depend on actor's bouding box, but I can't
>understand how it's computed.
>
>Has anyone done something like this ? 
>
>Thanks in advance,
>
>-- 
>Robert Riviere (Robert.Riviere at sophia.inria.fr)	    Tel: .4-92-38-7906
>CERMICS	/ INRIA					    Fax: .4-92-38-7740
>BP 93                              06902	Sophia Antipolis Cedex
>       - La vérité est ailleurs, elle est dans le Stroustrup -
>
>--------------------------------------------------------------------
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at public.kitware.com>. For help, send message body containing
>"info vtkusers" to the same address.
>--------------------------------------------------------------------
>
>


Brian Todd				"Evidently the operation of
email:      bat5 at po.cwru.edu		differentiation is rather 
home:       (216) 321-8882		unpleasent.  It can transform 
office:     (216) 368-4209		a nice function into one much
fax:        (216) 368-4969		less behaved" 	-GM Wing

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list