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.
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.
05-17-2022 06:50 AM - edited 05-17-2022 06:55 AM
@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).
05-17-2022 07:12 AM
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.
05-17-2022 08:14 AM - edited 05-17-2022 08:24 AM
@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:
I changed the color to red, just so I could see things better during fiddling:
You'll still see the lines through the polygons at some angles. Make the polygon offset small enough:
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, ...)