[vtkusers] viewport problems

Clinton Stimpson clinton at elemtech.com
Wed Apr 28 10:43:21 EDT 2004


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
> 
> 





More information about the vtkusers mailing list