[vtkusers] viewport problems
Amy Henderson
amy.henderson at kitware.com
Wed Apr 28 13:47:17 EDT 2004
Hi Clint,
You're right about ResetCamera not getting called every time you resize the
window. However, vtkCamera::ComputePerspectiveTransform gets called on
every render, provided the renderer has a non-zero size, and it also uses
the camera's view angle.
- Amy
At 12:39 PM 4/28/2004, Clinton Stimpson wrote:
>Hi Amy,
>
>I don't think it is just the ResetCamera that needs to be changed to give
>me what I need. If I resize a window, it doesn't call ResetCamera. If I
>had the entire model visibile with a square window, I still want it
>entirely visible while I resize the window, with no ResetCamera calls
>during the resize.
>
>Thanks,
>Clint
>
>
>Amy Henderson wrote:
>
>>Hi Clint,
>>
>>The reason this happens is that in vtkRenderer::ResetCamera, the camera's
>>position is computed using the camera's view angle, which is a vertical
>>angle, not a horizontal one. You can try using the
>>UseHorizontalViewAngleOn() method in vtkCamera, but then the objects in
>>your renderer will be clipped when the window's height becomes too small.
>>
>>- Amy
>>
>>At 10:43 AM 4/28/2004, Clinton Stimpson wrote:
>>
>>>My problem is not the front and back clipping planes. My sphere isn't being
>>>cut off from the front or the back.
>>>vtkRenderer::ResetCamera does the fit to make the model fit in the window.
>>>
>>>But my case is where the window has a smaller width than height. VTK can't
>>>fit the object in the window. You can do this in ParaView. Make a sphere,
>>>or whatever you want, then resize the window such that it is taller than it
>>>is wide. And keep making the width smaller, the object doesn't shrink to
>>>fit the window. Hit the "Reset View" button and it doesn't make the sphere
>>>fit in the window. If you resize the window so that you make it shorter
>>>than it is wide, the object will shrink in size to fit the window.
>>>
>>>It isn't just my app, it happens in ParaView too.
>>>
>>>Clint
>>>
>>>Quoting Luke Masters <masters_luke at hotmail.com>:
>>>
>>> > Hi Clint,
>>> >
>>> > I'm using Java and vtk, but what I would do is on the window resize event
>>> > I
>>> > would call the camera reset ( ren.ResetCameraClippingRange(); ). Dont
>>> > know
>>> > if it will work for you. I use it when I have big object, and I want it
>>> > to
>>> > fit in my window.
>>> >
>>> > " void vtkRenderer::ResetCameraClippingRange ( )
>>> > Reset the camera clipping range based on the bounds of the visible
>>> > actors. This ensures that no props are cut off "
>>> >
>>> >
>>> >
>>> > Luke Masters :)
>>> > masters_luke at hotmail.com
>>> >
>>> > >Hi,
>>> > >I have attached 3 small jpeg images of what I'm seeing.
>>>sphere1.jpg is
>>> >
>>> > >with a square window and a sphere. It looks fine. I make my window
>>> > >narrower, and part of my sphere is not visible anymore, as you can see
>>> > in
>>> > >sphere2.jpg. I would rather have what I see in sphere3.jpg when I make
>>> > my
>>> > >window narrower.
>>> > >Anyone have any ideas on how to do that? Thanks.
>>> > >Clint
>>> > ><< sphere1.jpg >>
>>> > ><< sphere2.jpg >>
>>> > ><< sphere3.jpg >>
>>> >
>>> > _________________________________________________________________
>>> > MSN Premium helps eliminate e-mail viruses. Get 2 months FREE*
>>> >
>>>http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>>>
>>> >
>>> >
>>>
>>>
>>>_______________________________________________
>>>This is the private VTK discussion list.
>>>Please keep messages on-topic. Check the FAQ at:
>>><http://public.kitware.com/cgi-bin/vtkfaq>
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>>
More information about the vtkusers
mailing list