[vtkusers] Repositioning Image within Render Window

David Gobbi david.gobbi at gmail.com
Wed Oct 20 22:12:39 EDT 2010


On Wed, Oct 20, 2010 at 7:32 PM, Alexis Cheng <acheng_1221 at hotmail.com> wrote:
> Hi David,
>
> By using the world coordinate system as ground, do you mean to use:
> coordinate->setCoordinateSystemToWorld

No, the "world coordinate system" is the name of the coordinate system
that all actors and the camera are positioned within.  So whenever I
work on a visualization problem in my head, the first thing I always
do is try to decide what coordinate system is the most fundamental to
whatever I am doing, and then I position all actors, cameras, etc.
with respect to that coordinate system.

So when using VTK for image-guided surgery applications, I usually
choose a patient-centric coordinate system and then relate all images,
actors, and the camera back to that coordinate system.  By identifying
the patient coordinate system with VTK's world coordinate system, then
I just have to set all the actor positions/orientations with respect
to the patient coordinate system that I chose and everything works
out.

> I have 2 renderers: backgroundRenderer and sceneRenderer
>
> Checking the ComputedWorldValue of each shows that they're both at 0,0. How
> do I actually move a renderer (sceneRenderer) within this render window? It
> doesn't seem like changing the position of the actor in sceneRenderer has an
> effect on the final render window.

It's best not to think of moving a renderer.  The renderer defines a
viewport into a 3D scene.  The camera settings define how the world
coordinates of the 3D scene map to the viewport.  Unfortunately the
VTK textbook only has half a page on coordinate systems and the VTK
user's guide doesn't really talk about them at all.  If you can, try
to pick up the OpenGL Reference Guide and User's Guide... they provide
a good description of the important coordinate systems and how they
relate to one another.

  David



More information about the vtkusers mailing list