[vtkusers] Strange misalignment of actors
Aart, E. van
E.v.Aart at tue.nl
Tue Feb 22 06:38:23 EST 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110222/0946c51c/attachment.htm>
More information about the vtkusers
mailing list