[vtkusers] viewport problems

Clinton Stimpson clinton at elemtech.com
Wed Apr 28 12:27:49 EDT 2004


Thanks Amy.  I'm not sure if people desire to have the current behavior 
or not.  But I'd rather have the model fit in the window regardless of 
the window size.  If I implemented a fix for this, do people want it to 
be the default behavior?  In general, the current behavior works fine, 
but in one particular case one user reported the model disappearing from 
the screen because of this.
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