Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Evermax

Member

03-04-2021 04:05 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

wiebe@CARYA

Proven Zealot

03-04-2021 07:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

LabVIEW Programming ((make LV more popular, read this)

altenbach

Knight of NI

03-04-2021 02:45 PM - edited 03-05-2021 10:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

Solution

Accepted by topic author Evermax

wiebe@CARYA

Proven Zealot

03-05-2021 02:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

LabVIEW Programming ((make LV more popular, read this)

03-05-2021 02:55 AM - edited 03-05-2021 02:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

Solution

Accepted by topic author Evermax

03-05-2021 10:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Update: It worked perfectly!

wiebe@CARYA

Proven Zealot

03-05-2021 10:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

LabVIEW Programming ((make LV more popular, read this)

03-08-2021 03:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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!

wiebe@CARYA

Proven Zealot

03-08-2021 04:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

LabVIEW Programming ((make LV more popular, read this)