LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wavy edges of intersecting objects in 3D picture with orthographic projection.

I am using a 3D picture control to display some 3D blocks using an orthographic projection.  The edges of the blocks do not render like I want.  The appear wavy where faces overlap like the hidden faces are being rendered on top the faces that are closer to the camera.  This happens along many of the edges if face culling is turned off.  With Cull Back Faces set, most of the wavy edges go away, but there is still a wavy edge where two boxes touch.  The wavy edges are not present when using perspective projection.  Does anyone know what is causing this problem and how it can be corrected?

0 Kudos
Message 1 of 2
(79 Views)

I found a solution that seems to address the problem, set row 2 column 2 = -0.01 in the 3D picture control's Projection Matrix Property.

I fumbled upon this solution by looking at some code that someone had posted when they were looking for help with another graphics issue.  Their code rendered overlapping objects the way that I would expect.  After looking at their code and trying several different configurations, I found the following:

1. It is possible to zoom when the Auto Projection property is set to Orthogonal if the Camera Controller Type is set to Oriented, but not if it is set to Spherical.

2. The edge rendering issue is initially present when the camera controller is Oriented, but disappears as soon as a little zooming happens.

3. Row 2 column 2 of the Projection Matrix is initially -0.000200002 when the camera controller is Oriented, but changes to -0.01 after zooming.

4. Setting row 2 column 2 of the Projection Matrix to -0.000200002 fixes the rendering problem.

To add additional context, I don't use the camera controller in the application that I am working on (so I never zoom with the Oriented camera controller), but use the transformation VIs to move, rotate, and scale the scene instead.

Message 2 of 2
(44 Views)