# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Plotting xyz points inside a cylinder

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?

Max

Message 1 of 9
(220 Views)

## Re: Plotting xyz points inside a cylinder

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

Message 2 of 9
(175 Views)

## Re: Plotting xyz points inside a cylinder

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

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 3 of 9
(163 Views)
Solution
Accepted by topic author Evermax

## Re: Plotting xyz points inside a cylinder

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

Message 4 of 9
(139 Views)

## Re: Plotting xyz points inside a cylinder

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.

Message 5 of 9
(132 Views)
Solution
Accepted by topic author Evermax

## Re: Plotting xyz points inside a cylinder

Update: It worked perfectly!

Message 6 of 9
(114 Views)

## Re: Plotting xyz points inside a cylinder

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.

Message 7 of 9
(108 Views)

## Re: Plotting xyz points inside a cylinder

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!

Message 8 of 9
(66 Views)

## Re: Plotting xyz points inside a cylinder

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

Message 9 of 9
(60 Views)