[vtkusers] reset camera

Rodrigo Valiña Gutiérrez rodrigo.valina at usc.es
Fri May 7 07:04:30 EDT 2010


Hi André.

I tryed before and after reseting the camera, and it does not work, it
only moves the object a bit.

This way:

renderer.GetActiveCamera().SetViewUp(0.0, 1.0, 0.0)
renderer.ResetCamera()
#renderer.GetActiveCamera().SetViewUp(0.0, 1.0, 0.0)

It seems that ResetCameta() only resets FocalPoint, and changes the
position but not reset it.

I do the following. It matters?

self.widget.GetInteractorStyle().SetCurrentStyleToTrackballCamera()

Any idea?

Rodrigo

On Fri, May 7, 2010 at 12:17 PM, André Prins <a.h.prins at gmail.com> wrote:
> Hi Rodrigo,
>
> Unfortunately the ResetCamera() resets the viewdirection (using
> SetPosition() and SetFocalPoint()) but not the viewup vector.
> To reset the orientation as well, reset it before reseting the camera: E.g.
>
>    renderer->SetViewUp( 0, 1, 0 ); // assuming this is your initial
> viewup-vector
>    renderer->ResetCamer( );
>
> Regards,
> André
>
> On Fri, May 7, 2010 at 10:20 AM, Rodrigo Valiña Gutiérrez
> <rodrigo.valina at usc.es> wrote:
>> Hi,
>>
>> I want to reset the camera, and I am using:
>>
>> renderer.ResetCamera().
>>
>> That resets the position and size, but not the rotation of the object.
>> I wanted to place it in the default orientation (like initial
>> orientation), but I don't find any method that works.
>>
>> I can not use the saved position of the camera because in my scene,
>> the number of objects may have changed, and thus the center and size.
>>
>> Is there any form of reseting the camera rotation which works for any
>> scene configuration ?
>>
>> --
>> Rodrigo
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list