[vtkusers] QVTKWidget camera problem

Ken Martin ken.martin at kitware.com
Tue Nov 17 14:28:32 EST 2015


renderer->ResetCameraClippingRange()  maybe? That and
camera->OrthogonalizeViewUp() are the two common things to try when manual
camera changes do not work.

Thanks
Ken

On Tue, Nov 17, 2015 at 2:15 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> I have now established conclusively that adjusting the camera setup with
> SetPosition and SetFocalPoint stops the scene from being displayed, while
> any movement of the mouse with a button down restores display.
>
> qvtkWidget = new QVTKWidget(page,QFlag(0));
>
> QVBoxLayout *layout = new QVBoxLayout;
> layout->addWidget(qvtkWidget);page_VTK->setLayout(layout);ren = vtkRenderer::New();
>
> renWin = qvtkWidget->GetRenderWindow();
>
> renWin->AddRenderer(ren);
>
> ren->ResetCamera();
> iren = qvtkWidget->GetInteractor();
>
> vtkSmartPointer<MouseInteractorStyle4> style = vtkSmartPointer<MouseInteractorStyle4>::New();
>
> iren->SetInteractorStyle( style );
>
> iren->Initialize();
>
> ren->GetActiveCamera()->SetPosition(0, 0, 0);ren->GetActiveCamera()->SetFocalPoint(x0, x0, x0);
>
>
> If I remove the last two lines the scene is centred OK, but not at the
> scale I want.  I can play with Zoom(), but SetFocalPoint(x0,x0,x0) ensures
> that I get the desired scaling directly.
> Is this the expected behaviour?  I'm wondering if it is the result of
> using the QVTKWidget "default" camera instead of creating a new one to use
> (please excuse deficiencies in my understanding).  Is Zoom() the only way
> to achieve what I want?
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151117/d71fa896/attachment.html>


More information about the vtkusers mailing list