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.
03-04-2021 04:05 AM
Dear all,
I want to plot xyz points inside a semi-transparent cylinder (would be optimal if I could turn the transparency of the cylinder on/off).
Is it possible to combine my 3D graph VI (Solved: How to plot a xyz-points 3D-graph with different colours? - NI Community) and the 3D picture geometry VI to plot the xyz points within a cylinder? Or is there some easier solution for this problem?
Thank you all in advance.
Max
Solved! Go to Solution.
03-04-2021 07:02 AM
@Evermax wrote:
Or is there some easier solution for this problem?
I don't think there's any way to adjust any aspect of the shipped 3D graphs. They are written way to rigid.
Transparency and 3D is never easy.
OpenGL (and Direct3D, and graphic cards in general) are traditionally based on the idea of a Z-Buffer. The Z-Buffer simply keeps the depth of every pixel drawn. This only works for 1 depth value, and that makes transparency very tricky.
You might have to pull tricks, like drawing the cylinder twice, once with front face culling, once with back face culling, in the right order.
It would help if you posted an idea of the end result. "Points inside a cylinder" can mean a lot of things.
03-04-2021 02:45 PM - edited 03-05-2021 10:54 AM
The parametric surface graph has an option for opacity and should solve your problem.
(Here I graph color data on a spherical surface (used here) and if I make it opacity=0.5, you'll see the three opaque planes shining through.)
If I can make a parametric surface sphere, you should be able to make a cylinder. 😄
03-05-2021 02:44 AM
@altenbach wrote:
The parametric surface graph has an option for opacity and should solve your problem.
(Here I graph color data on a spherical surface (used here) and if I make it opacity=0.5, you'll see the three opaque planes shining through.)
If I can make a parameteric surface sphere, you should be able to make a cylinder. 😄
But that gives points on a surface of a cylinder (if that is indeed possible.
Not sure, but it seems OP wants point inside a cylinder?
Also, it seems to make the sphere transparent, but I don't see the points on the back of the sphere? Again, if that's what OP wants...
Any example code that shows how to put the opaque triangles on the graphs canvas? I usually give up on those 3D graphs after 10 min.. Perhaps in stead of triangles behind the surface, there's a way to put points inside the surface?
03-05-2021 02:55 AM - edited 03-05-2021 02:55 AM
To make it more clear: My idea was to plot a sphere/cube of xyz points which lays inside a cylinder.
I think I will try to plot a parametric surface graph cylinder in the same 3D graph. I will see, if the transparency settings work.
03-05-2021 10:21 AM
Update: It worked perfectly!
03-05-2021 10:27 AM
Could you post anything?
I don't recall how to mix the 3D graphs with other data. I'll probably figure it out if\when I have to, but others might not.
03-08-2021 03:26 AM
I enabled with the 3D graphs "Set Plots.vi" two graphs. One for the xyz points with the "3D Curve.vi" and one graph for the cylinder with the "Parametric Surface.vi" (as shown in the snippet below). It's a big plus point for me, that you can combine two or more 3D graphs easy with 3D graphs.
Hint: I swapped the y- and z-coordinates of the cylinder, because I wanted to change the z-direction of the cylinder. If you want to use it regularly, you have to change it back.
Hope this helps you!
03-08-2021 04:44 AM
Ah, I was looking at the class based 3D plots that use the 3D picture control (that you automatically get when dropping a 3D graph from the front panel).