LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

half transperent mesh

Dear comunity,

 

The problem: semi transparent mesh in 3D Picture control how to?

 

I also tried semi transparent boxes spheres ... I't seem that the alpha canal  is not working

 

thx

Martin

0 Kudos
Message 1 of 19
(3,271 Views)

" I't seem that the alpha canal  is not working"

 

 

I don't understand this..  Can you post code and a better explaination of what you mean by it doesn't work? 

 

 

Jeff Peters

LabVIEW R&D

0 Kudos
Message 2 of 19
(3,249 Views)

Hi Jeff, atttatched an example.

 

I would expect that the lower half of the cylinder to be shining through the disk.

 

and by the way creating the new objekts within the while loop seems not to be the best way as memory gets cluttered but if I put them outside the loop I get a invalid reference ( maybe I should use local variables?)

 

thanks

 

Martin 

0 Kudos
Message 3 of 19
(3,238 Views)

There are a few things that you didn't do that will help. 

 

1.  You have to turn blending on for the scene, otherwise semi-transparent objects won't be blended.

2.  You have to depth sort your objects... that is, you should ensure that objects that are behind another semi-transparent object are drawn first.  In general, we draw the root object, then the children objects. 

This isn't strictly necessary in all cases.  The transparent bin (blending.bin) can do some of this for you, but it doesn't handle objects that intersect each other very well.

3.   You will probably see artifacts when rotating the scene around. This is because the cylinder is blending with itself.  You can fix this by setting the face culling mode to back faces, meaning back faces are not rendered.

 

Blending is very complicated and it involves a lot of options that you have to set in order to for things to look right.  Here is an updated version of your scene that I think accomplishes what you wanted.  I will be filing a documentation CAR that will describe how to configure blending so that others might not be confused in the future.

 

If you have any questions about what I did, please respond.  I will go into more detail if necessary.

 

Jeff Peters

LabVIEW R & D.

 

 

0 Kudos
Message 4 of 19
(3,210 Views)

Hi Jeff,

 

I have tryed to understand what you have been doing --- more documentation would help so it's like trying to hunt in a dark and foggy night.

The example does something: The two cylinders get transparent (the background shines trough) but still the disk completly obscures the pillar

 

Still my problem seems to be solved

 

see attached file

 

but now the monster has grown an other head: why is the sphere not a sphere or why does the aspect ratio of the 3D control distort the content

 

Martin Burger 

 

 

 

 

0 Kudos
Message 5 of 19
(3,199 Views)

You didn't attach the file whoops.

 

I was under the assumption that you wanted the large cylinder to obscure the smaller.

If you need both to be semi-transparent, you will probably need to turn the depth test off.  What will happen when you draw the small cylinder is that the renderer will realize that it has drawn an object at a particular pixel closer, thus it will not need to render the cylider at that pixel.  Of course, that isn't true if the object in question is semi-transparent.

 

Here is your example doing that.

 

Now about the sphere.  You probably have a warped viewport.  You should try using autoprojection on the scenegraph control which will automatically maintain proportions if you grow/size the control.

0 Kudos
Message 6 of 19
(3,193 Views)
0 Kudos
Message 7 of 19
(3,190 Views)
Sorry, your attachment is missing a lot of subvis.  Can you either attach them or give a new example where the subvis aren't necessary?
0 Kudos
Message 8 of 19
(3,153 Views)

Sorry

 

but tried some more experiments and came up with strange things

 

SemitransperancyTest   looks OK

Semi transperancyTest1  looks crapy

 

Why

 

with a lot of thanks

 

Martin

0 Kudos
Message 9 of 19
(3,131 Views)

I don't know exactly what you meant, but I think it might look bad because you have lighting turned on, but haven't supplied normals for your mesh.

 

Try turning lighting off.

 

Here is an example that does just that.  (Drop it in the semitransparencytest1 folder)

 

 

0 Kudos
Message 10 of 19
(3,126 Views)