[vtkusers] Strange misalignment of actors

Dženan Zukić dzenanz at gmail.com
Tue Feb 22 07:57:51 EST 2011


Perhaps your scene is large, and your depth buffer precision is insufficient
(thus causing z-fighting)? I am a beginner in VTK, but this idea might help.

Dženan

On Tue, Feb 22, 2011 at 12:38, Aart, E. van <E.v.Aart at tue.nl> wrote:

> Hi all,
>
>
>
> This may be a long shot, but I’m not sure what else to try.
>
>
>
> My situation is as follows: In the most basic configuration, I have two
> actors in a 3D scene: 1) A plane, defined as vtkPolyData object with four
> points (the corners) and using a vtkTexture, mapped through a
> vtkPolyDataMapper, and 2) a small convex polygon, also a vtkPolyData object,
> also mapped through a vtkPolyDataMapper. Each of these actors is part of a
> vtkAssembly (used to group them together with other actors, which are not
> relevant for this basic situation), and the two vtkAssembly objects are
> attached to the same vtkRenderer, using the same camera and everything.
>
>
>
> The problem is this: When viewing the plane from the side (i.e., view
> direction parallel to the plane), the polygon is close to the plane, but
> does not touch it. This is correct, looking at the 3D coordinates of both
> the plane and the polygon. HOWEVER, when I move the camera towards a view
> direction perpendicular to the plane, the polygon appears to intersect the
> plane: the part of the polygon closest to the plane appears to be going
> through this plane, even though the 3D coordinates of the actors make such
> an intersection impossible. How much of the polygon comes through the plane
> depends on the camera angle; as said, when the view direction is close to
> parallel to the plane, no intersection is visible, and the closer we get to
> a perpendicular view direction, the more of the polygon comes through the
> plane. In other words, moving the camera appears to change the relative
> position of the two actors, which is wrong and undesired.
>
>
>
> To make matters more confusing: Adding the polygon actor to the same
> assembly as the plane actor solves the problem: the relative position of the
> actors does not change, and no intersection occurs. However, due to the
> structure of my program, keeping all actors in one assembly is not an
> option.
>
>
>
> I know this must sound terribly vague, but I’m currently out of ideas, so I
> was hoping someone could at least push me in the right direction.
>
>
>
>
>
> Kind regards,
>
>
>
>
>
> Evert van Aart
>
> Eindhoven University of Technology
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110222/5de0a6be/attachment.htm>


More information about the vtkusers mailing list