LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot 3D surface graph from X,Y,Z points?

Hi altenbach,

 

Thanks for your help. I think I can fix the problem thanks to you. Maybe I can upload the fix in a bit. Thanks again.

 

 

0 Kudos
Message 11 of 34
(11,234 Views)

Hi, I'm working on a similiar project here and was wondering if the surface graph could be used to build a 3D model based on a cloud of XYZ coordinates. Also, I'm a bit confused about the Z- axis array. Is it possible to explain this in a little more detail?

0 Kudos
Message 12 of 34
(11,102 Views)

Oh yes, If I'm not mistaken the 3D surface VI has 2 modes. one for vector and one for matrix.

If i am not mistaken, XYZ coordinate data are in the form of matrix, right? Wouldnt the data output be a different when we use the vector to build the 3D surface?

0 Kudos
Message 13 of 34
(11,060 Views)

I linked the point to the 3D scatter, and they look perfect!

 

I tried using the prescribed method to form a 3D surface between the points  but somehow the 3d surface was not formed as planned. Its just a plain sheet when it should; when referring to the 3D scatter, form surfaces connecting each of the points in the point cloud.

Did i wire 3D poly wrongly?

 

I've attached the coordinate data, the VI starts by loading the coordinate data first.

Download All
0 Kudos
Message 14 of 34
(11,029 Views)

hi,

how could i draw a simple sphere, with radius = 2 units and center in point (5,5,5)?

i'm using labview 8.0 and i'm very confused about x, y and z matrix generation.

thanks

0 Kudos
Message 16 of 34
(10,987 Views)

Maybe you are familiar with a parametric graph where x and y are a function of a third variable. A parameteric surface graph extends it in three dimensions where you have X, Y, Z as a function of two other parameters. Here is the wikipedia entry that summarizes both.

 

Do a google search on parametric surfaces and you might find a few sites that explain it.

 

Here's a simple sphere where x, y, and x are dependent on two paramters theta and phi. It was created in LabVIEW 2012 and I don't know if it correctly converted down to LabVIEW 8.0. To translate it to x0, y0, z0 (e.g. 5,5,5), you would simply add these values to the respective 2D arrays (not shown)

 

 

0 Kudos
Message 17 of 34
(10,986 Views)

the vi didn't work in LV8.0 but it's all right, you gave me a good idea about matrix generation. i'll learn more about parametric surfaces and try again. if i have other question, i'll come back 🙂

thanks

 

taking this opportunity, i create a post asking how create a solid revolving a function around an axis and draw it in 3d graph. do you have any idea how could i do this?

0 Kudos
Message 18 of 34
(10,968 Views)

Hi Ten_Jones,

 

I tried to convert the file to LabVIEW 8.0 as well and attached it.

 

Could you please give more details on what you're trying to implement? What sort of function are you trying to rotate? Do you need to be able to rotate the solid, or do you only need to draw a solid that is the result of a function rotation?

 

LabVIEW doesn't have any built-in functions for doing this. Your implementation would be similar to the VI altenbach showed you before - do the math for creating the points you need, then plot them to a 3D graph. If you give me more details on what you're trying to accomplish I can help direct you to the right resources, but I suggest you look online for general examples of graphing what you need. Once you have a clear understanding of the math you're trying to implement it will be easier to help you move that into LabVIEW.

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 19 of 34
(10,943 Views)

Hey guys, I solved my problem relating to the surface VI. It seems that i have mislooked upon the dimensions of my data. To put it in simple terms, the value of XYZ coordinates do not specify the dimension of your data. It is the amount of points in which Data is sampled along those Xand Y axis.

 

Simply put, how many data do you sample across the x axis and then how many data you ahve sampled along the Y axis? With that data, reshape the array for the Z coordinate according to the dimension

 

EG: I sample 12 points on the x axis and then 12 points along the Y axis so the dimension for the Z matrix must be a 2D array of 12x12 size.

 

The same goes to the parametric surface. Both X,Y and Z 2d matrix are actually arranged according to the dimension in which the data was sampled! With X any Y sampling dimension (Not the value of the X and Y coordinates!) as reference to the array size!

 

Thus using the example above

 

X,Y,Z matrix = 16X16 2D dimension array

 

i and j in the help file actually refers to the dimension size! Not the coordinate positions!

 

So for my case, i got my image.

 

3d snip.PNG

 

I got the 3D image from the 3D parametric graph.

 

So in point terms

 

1) Identify the dimension of data

2) Identify What type of plot do you want? Generally surface graph VI plots surfaces, parametric is better at plotting 3D images

3) Build the 2D matrix according to your dimension 

4) Run and enjoy the image.

 

 

This might not be a good guide, butI hope this helps others who are plotting a simple 3D image from coordinates. =D
Remember to give Kudos if you found this helpful!

0 Kudos
Message 20 of 34
(10,926 Views)