LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make 3D picture control object transparent?

Hi all,

I did the following:

* create a 3D scene with a rather flat box (like a sheet of paper)
* put a texture on the box; the texture comes from a png file and has transparency

I can now see the objects ambient color through the transparent texture. Ok.

I now tried to make the object itself (its ambient color) transparent, in order to have the texture bitmap as a free standing 3D object, like cut out from a piece of paper. Using the alpha channel does not work - the object remains opaque all the time.

Any ideas or hints out there?

Best regards
Matthias
0 Kudos
Message 1 of 6
(4,166 Views)

You probably are applying the texture as a decal instead of as a replacement.  See the "Apply Mode" property on SceneTexture for more details and/or check out this example.

 

 

Message 2 of 6
(4,137 Views)
You probably don't need it, but on the VI that I posted I forgot to add indicies to the second mesh.  Here is an updated VI.
0 Kudos
Message 3 of 6
(4,128 Views)
Hi,

thanks a lot. That was an excellent solution; I also appreciate the idea to put the texture onto a simple quad mesh instead of putting it on a box, as I did. My box always had a backside (I could get rid of the other 4 faces by making it very thin), and that shone through to the front side after the transparency thing finally worked... So: Great!

Regards
Matthias.
0 Kudos
Message 4 of 6
(4,120 Views)

Ok a big piece of thread necro here:

 

I am trying to generate a texture for placing on an onject with alpha transparency and I am having trouble formatting the data correctly so that I can apply it.  I have tried modifying the blending.vi but to no avail, I am doing something wrong converting from a (present) 8-bit texture to a 32-bit RGBA texture.  Anyone know how the pixels are arranged internally in a 32-bit texture?

 

Shane.

 

ps I think I may have misudnerstood the importance of the mask data.  I assumed since the data was 32-bit that the transparency was in there, but perhaps this isn't the case?

0 Kudos
Message 5 of 6
(3,235 Views)

I got a little stuck on this as well. Turns out that the flattenned pixmap can also be 32-bit!  (24-bit RGB + 8-bit Alpha) You'll have to roll your own conversion, because the C:\Program Files\National Instruments\LabVIEW 2018\vi.lib\picture\pixmap.llb\Flatten Pixmap.vi doesn't have this capability.  You can get a example of a 32-bit pixmap by following the Read PNG file.

http://zone.ni.com/reference/en-XX/help/371361N-01/lvpict/read_png_file/

 

as Intaris pointed out elsewhere, 255 is opaque and 0 is transparent.

0 Kudos
Message 6 of 6
(2,042 Views)