01-09-2019 10:57 AM
I'm working on displaying point clouds in LabVIEW using the 3d picture control and meshes drawing points only, the one thing I can't get working is two sided normals, something that I know is supported in opengl (which I believe LabVIEW uses for the picture control) via the glLightModeli method.
Can anyone shed any light on whether this is possible in LabVIEW or how I may be able to simulate this functionality so that each of my points reflects from both faces?
01-09-2019 12:08 PM
a dumbed down sample VI in 2016 or earlier?
I have done point clouds in the 3D picture...
But is has been a long time.
Ben
01-10-2019 04:35 AM
I've attached a basic VI (LV2016) that shows some example data rendered as a point cloud, the reason for wanting to use specular reflections and hence the normals is that this highlights surface details, due to the nature of point clouds each data point needs to be rendered with two faces to allow this detail to be seen from either side of the model.
(The attached VI only has a subset of the data for size reasons)
Point Cloud Scan, note the dark areas of non-reflection due to single sided normals
01-10-2019 05:17 AM
Nice. I render my 3D grid with 3 directional layers
I'll try what happens when I render it with this method.
As for the problem... Sadly, NI choose to leave out some OpenGL options, seemingly at will... I think the reasoning was "we don't see how this is useful (in a scene graph), so we'll just remove it to be safe". I was in need of a few options that where in OpenGL, and not in LabVIEW.
Definitely frustrating.
As for glLightModeli, I'm not sure if it would help it was available:
|
The param parameter is a single integer value that specifies whether one-sided or two-sided lighting calculations are done for polygons. It has no effect on the lighting calculations for points, lines, or bitmaps. If param is 0 (or 0.0), one-sided lighting is specified, and only the front material parameters are used in the lighting equation. Otherwise, two-sided lighting is specified. |
01-10-2019 07:14 AM - edited 01-10-2019 07:27 AM
You aren't working with any Light sources. Maybe adding the light sources and then setting the properties for specular lighting may helpy ou get where you want to go. I know from experience that some properties one would automatically associate with 3D pictures are only valid for lighted scenes.
Just don't ask me how to do it, I always found it tiresome and complicated.
I have wanted to have a normal map for a texture (per pixel) but such a construct does not exist. There IS a blending option, however which applies and underlying geometry to the texture, but I never understood this and never got anywhere close to a working example to get an idea how it works.
01-10-2019 07:46 AM
@Intaris wrote:
You aren't working with any Light sources.
There seems to be a default light? The image does look lit by a light, and when I add a light 0, this lightning disappears. Tweaking the light results in the same effect as with no added light.
@Intaris wrote:
Just don't ask me how to do it, I always found it tiresome and complicated.
I concur. The scene graph model really complicates things. Ironically, as it's supposed to make things easier. I'd prefer a solution exposing raw OpenGL functionality. I'd be happy to use the OpenGL API. I own at least 4 books on OpenGL, so I'll manage. 0 books on the 3D picture control though...
Of course, at some point a Vulkan interface would be really nice.
01-10-2019 07:54 AM - edited 01-10-2019 07:57 AM
OK, maybe the default light is just what I see. My recollection was that there were differences between a scene with zero lights and a scene with 1+ lights. But it might just be that I had never found equivalent settings like you have.
I have dabbled at best in the 3D picture control. (My Avatar picture is a result of some of that dabbling)
01-10-2019 08:05 AM
As for a solution, I guess rendering the points as a mesh would be an obvious suggestion. But I think the application doesn't allows (as points 'fall out of the mesh')?
How about rendering the points as polygons\triangles? Then you might still have the normal problem. But you could then render the mesh twice. Once as it is, once with reversed normal (and triangles). Then render with back faces culled, to get shiny polygons on both sides. *Sigh*.
Hard? Yes. Try working with transparency if you want a 2nd challenge...
01-10-2019 08:16 AM
Appreciate all the ideas so far, in terms of what I've tried:
01-10-2019 08:16 AM
I tried duplicating the points, setting ambient and diffuse to full transparency, inverting the normal for the second set of points....... Trying to get only specular lighting. Didn't work (or at least I couldn't get it to work, those two statements are very much not equivalent.... 🙂 )