From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Picture Control - Blending / Overlay


@Mephiengineer wrote:

In contrast, I want to avoid this transparency and I do not really get it why the transparency appears and disappears for the same surfaces when I rotate the view


There's no transparency, you're rendering wireframes.

 

You should be rendering polygons if you want the polygons to hide what's behind them.

 

Then, if you want wire frames, I think you need a 2nd rendering. So, render the solid shape (this set's the Z-Buffer). Then render the wire frames with a small Z Offset. Not sure if this is even possible in the limited interface NI calls 'easy'. It sure is in OpenGL. glPolygonOffset function (Gl.h) - Win32 apps | Microsoft Docs.

 

In OpenGL, you'd simply set rendering to line and fill:

glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );

But again, the LV SceneGraph made it 'easy' for us by limiting our options...

 

In short, rendering wireframes while occluding what's behind it might not be possible (or feasible).

0 Kudos
Message 11 of 13
(336 Views)

I render both wireframes and polygons. The polygons hide what´s behind when looking at them at some angle, but at some angle not. Have you took a look at the attached program? I think it will describe the issue much better than I can.

0 Kudos
Message 12 of 13
(331 Views)

@Mephiengineer wrote:

I render both wireframes and polygons. The polygons hide what´s behind when looking at them at some angle, but at some angle not. Have you took a look at the attached program? I think it will describe the issue much better than I can.


I hade a look a while ago. I looked again...

 

In the second pass (the wireframes) you turn off depth test. So, everything is simply rendered over what's there, ignoring the z buffer completely.

 

Then, it's a matter of setting the right polygonoffset and rendering to the right bin:

wiebeCARYA_0-1652793141415.png

I changed the color to red, just so I could see things better during fiddling:

wiebeCARYA_1-1652793191846.png

 

You'll still see the lines through the polygons at some angles. Make the polygon offset small enough:

wiebeCARYA_0-1652793426794.png

wiebeCARYA_1-1652793488832.png

wiebeCARYA_2-1652793544180.png

 

 

Apparently unit and factor are not simply multiplied. E.g.  (0.1, -1) isn't (-1 0.1) the details elude me, but it's passed as is to OpenGL, so it's a matter of reading enough of the documentation to understand: glPolygonOffset function (Gl.h) - Win32 apps | Microsoft Docs:

 

(The value of the offset is factor * ?z + r *units, ...)

 

0 Kudos
Message 13 of 13
(321 Views)