From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting xyz points inside a cylinder

Solved!
Go to solution

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

0 Kudos
Message 1 of 9
(1,366 Views)

@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. 

0 Kudos
Message 2 of 9
(1,321 Views)

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.)

 

altenbach_0-1614890500569.png

 

 

If I can make a parametric surface sphere, you should be able to make a cylinder. 😄

 

0 Kudos
Message 3 of 9
(1,309 Views)
Solution
Accepted by topic author Evermax

@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.)

 

altenbach_0-1614890500569.png

 

 

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?

0 Kudos
Message 4 of 9
(1,285 Views)

To make it more clear: My idea was to plot a sphere/cube of xyz points which lays inside a cylinder.

Evermax_0-1614934298437.png

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.

0 Kudos
Message 5 of 9
(1,278 Views)
Solution
Accepted by topic author Evermax

Update: It worked perfectly!

Evermax_0-1614961264237.png

 

0 Kudos
Message 6 of 9
(1,260 Views)

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.

0 Kudos
Message 7 of 9
(1,254 Views)

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.

 

Create_3D_graph_sphere.png

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!

Message 8 of 9
(1,212 Views)

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).

0 Kudos
Message 9 of 9
(1,206 Views)