[vtkusers] vtkCamera as X-Ray camera

Taylor Braun-Jones taylor at braun-jones.org
Fri Apr 19 08:17:39 EDT 2013


Thanks David! This answered all my questions about vtkCamera and I was able
to setup my scene geometry properly.

On a related topic, I wonder if some of the VTK class documentation would
benefit from diagrams to help explain the geometry concepts? If so, I'd be
happy to put something together for vtkCamera. What would be the preferred
format? .dia from which the Doxygen build system generates .png images?


On Wed, Apr 17, 2013 at 7:59 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> On Wed, Apr 17, 2013 at 5:22 PM, Taylor Braun-Jones
> <taylor at braun-jones.org> wrote:
> > On Wed, Apr 17, 2013 at 6:01 PM, David Gobbi <david.gobbi at gmail.com>
> wrote:
> >>
> >> Props can be anywhere.  But if you want them to be visible, they must
> lie
> >> between the near clipping plane and the far clipping plane, which are
> set
> >> with camera->SetClippingRange(double dNear, double dFar).  These are
> set as
> >> distances from your camera position.  In order for things to be visible,
> >> they must be at least "dNear" distance from the camera, and must not be
> >> further than "dFar" distance from the camera.
> >>
> >> "Position" is always the camera position in world coordinates.
> >
> > Just to be clear - "the camera position" is the green dot in the diagram?
>
> Yes.  If the green dot is the source of the X-rays, then that is where
> you want to put the VTK camera.
>
>
> >> "FocalPoint" must lie between the green point and the purple point that
> >> are shown on your diagram. I recommend that it be within the grey blob
> (i.e.
> >> within the "patient").
> >
> >
> > This is one part of the vtkCamera geometry that is not totally clear to
> me -
> > why do you recommend that the focal point be within the grey blob? As
> long
> > as the Position, ViewAngle, and ClippingRange are set correctly, what
> would
> > be the difference with using some other point on the
> > green-point-to-purple-point vector? I bring this up partly because I
> forgot
> > to mention that, in addition to the grey blob, I also want to view the 2D
> > image plane which I have positioned and oriented in 3D world space.
>
> As far as the camera "geometry" is concerned, the only purpose of the
> focal point is to set the direction of the camera.  However, other VTK
> objects such as the VTK interactors use the focal point as their first
> guess for where the center of the 3D scene is.  So it should usually
> be at the center of whatever object you consider to be the most
> important.
>
>
> >> And of course I highly recommend that you set the ClippingRange as well.
> >> The dNear can be set to half of the distance from the camera position
> to the
> >> focal point, and the dFar should be set to the distance from the camera
> >> position to the detector.
> >
> >
> > dFar makes sense to me, but how do you come up with "half the distance
> from
> > the camera position to the focal point" for dNear? Is this just a rough
> > heuristic?
>
> Yes, it's a heuristic.  Just make sure that dNear is closer to the
> camera than any object in the scene that you want to see.
>
>  - David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130419/32f61390/attachment.htm>


More information about the vtkusers mailing list