[vtkusers] Cool sample does not work, need help !!

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed Sep 22 08:14:59 EDT 2004


Am I right in thinking that when you zoom in, you want the tiny window to
show the frustum (in perspective mode) so that the box gives you the viewing
region?

If yes, then I've done this before and I'll see if I can find the code and
paste it in.

JB

----- Original Message ----- 
From: "de Boer Ingo" <I.deBoer at polytec.de>
To: <vtkusers at vtk.org>
Sent: Wednesday, September 22, 2004 9:06 AM
Subject: RE: [vtkusers] Cool sample does not work, need help !!



Hi,

is there no one to help on this ??

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255


> -----Original Message-----
> From: de Boer Ingo
> Sent: Monday, September 20, 2004 12:26 PM
> To: Andrew Maclean; vtkusers at vtk.org
> Cc: vidyadhar at lucidindia.net
> Subject: RE: [vtkusers] Cool sample does not work, need help !!
>
>
> Hi,
>
> I tried the frustum planes. But it still does not work for
> perspective projection, only for parallel projection.
> Did I do anything wrong in my programming, did I miss something ?
>
> Any further hints on this sample ? This new sample uses the
> frustum planes...
>
>
> greets
>   Ingo
>
> ---
> Dr.-Ing. Ingo H. de Boer
>
> Polytec GmbH
> Polytec-Platz 1-7, 76337 Waldbronn, Germany
> phone: ++49 7243 604 106
> fax  : ++49 7243 604 255
>
>
> > -----Original Message-----
> > From: Andrew Maclean [mailto:a.maclean at cas.edu.au]
> > Sent: Wednesday, September 15, 2004 1:00 AM
> > To: de Boer Ingo; vtkusers at vtk.org
> > Subject: RE: [vtkusers] Cool sample does not work, need help !!
> >
> >
> > It is definitely a cool sample!
> >
> > As you indicate, what you have written works perfectly well
> > for parallel
> > projections. If you look at DisplayToWorld() in your code,
> there is no
> > perspective transform being applied to the coordinates, so
> Pt4[3] will
> > always be 1. You are simply taking the viewport coordinates
> > and converting
> > them to world coordinates. This is fine for parallel
> > projections but not for
> > perspective projections.
> >
> > For perspective projections, you actually need the view
> > frustum and you can
> > get the planes bounding this from
> > vtkCamera::GetFrustrumPlanes(), remember
> > :- the "aspect" is the width/height of the viewport. My
> > initial approach
> > would be to construct a frustum from these planes and use the
> > edges of the
> > nearest face as your bounding rectangle. This will also work
> > for parallel
> > projections, however the frustum will simply become a cube in
> > this case.
> >
> > An alternative approach may be to use vtkCamera::
> > GetPerspectiveTransformMatrix() and
> > vtkCamera::GetViewTransformMatrix() to
> > directly map the viewport bounds to word coordinates. However
> > I think that
> > using vtkCamera::GetFrustrumPlanes() will be a better approach.
> >
> >
> > Let me know how this works. We (the users group) would love
> > to see the final
> > result!
> >
> >
> > Regards,
> >    Andrew
> >
> > ___________________________________________
> > Andrew J. P. Maclean
> > Centre for Autonomous Systems
> > The Rose Street Building J04
> > The University of Sydney 2006 NSW
> > AUSTRALIA
> > Ph: +61 2 9351 3283
> > Fax: +61 2 9351 7474
> > URL: http://www.cas.edu.au/
> > ___________________________________________
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: de Boer Ingo [mailto:I.deBoer at polytec.de]
> > Sent: Friday, 10 September 2004 21:18
> > To: vtkusers at vtk.org
> > Cc: vidyadhar at lucidindia.net
> > Subject: [vtkusers] Cool sample does not work, need help !!
> >
> > Hi all,
> >
> > Vidyadhar and I are working on this cool zoom sample.
> > We have a cube in a large and small renderer. Now, when
> > you zoom into the large renderer, you see a red rectangle
> > in the small renderer to show you the zoomed ROI from
> > the large renderer... well... play with it, you'll get it ;)
> >
> > There is still a problem :(
> >
> > The sample only works okay in parallel projection. The
> > perspective projection does not work !!
> >
> > So, this goes out to all the VTK gurus to take a look at
> > this. This sample could also be a nice one for the VTK CVS
> > and very usefull to some other users.
> >
> > You can toogle the perspective/parallel with the line
> >
> > #define _WORKING_SAMPLE_
> >
> >
> > greets
> >   Ingo
> >
> >
> > ---
> > Dr.-Ing. Ingo H. de Boer
> >
> > Polytec GmbH
> > Polytec-Platz 1-7, 76337 Waldbronn, Germany
> > phone: ++49 7243 604 106
> > fax  : ++49 7243 604 255
> >
> >
> >
>



----------------------------------------------------------------------------
----


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