LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Here is a neat trick using 3D surface graph

I was trying to solve a 3D graphing problem, where I wanted to plot a 3D
surface using a random set of points located on the surface of a person's
head. There are examples for doing something close to this in LabVIEW,
but they are for sheet functions only. It doesn't work if you want the
surface to curl around underneath itself, in the negative Z direction.
You can basically get something that looks like a face mask, but not a
whole head.

Other examples in LabVIEW, such as Torus.vi, show a true 3D graph, but the
input data is as 2D X, Y, and Z matrices, which I don't think can be
obtained from a random set of points on a surface (if you know how to do
this, I'm interested!).

It looked like there
was no way to do what I wanted to do! But, after some
playing around, I discovered a way to get what I want.

For your particular Plot:

1) Set Property:CoordinateSystem = cwCartesian

2) Do a coordinate transformation on your Cartesian (XYZ) data so that it
is centered on the origin (just subtract the mean for each axis). Convert
your XYZ data into spherical coordinates, so that you have 1D arrays of
phi, theta, and rho. Use Method:Plot3DMesh to input these three arrays
into the X,Y,Z vector inputs.

3) Set Property:CoordinateSystem = cwSpherical. This must be done only
after your data has been input in the previous step.

4) Turn off color shading, and use illumination to make it look nice.

Note: the fill color doesn't work right when you try to set it programmatically,
and the W vector for color doesn't do anything. Displaying contour lines
makes a mess, but displaying normals looks ok.

It would be nice if there was a cleaner way of doing this. A
lso, some palettes would be nice too. Any chance NI is planning on adding palettes, such as for illumination control, so I don't have to do it programmatically?

-Chris

supercathode@yahoo.com
0 Kudos
Message 1 of 3
(3,298 Views)
In order to use the wVector you must also use the 'ColorMapValues' and 'ColorMapColors' prop nodes. The 'ColorMapStyle' must also be set to 'Custom'. I modified your code so that random sections of the head are orange. I put in a While Loop so that you can spin the little guy's head when the VI is running.

Looks like an interesting project. Are you doing something with 3D sonograms?

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

0 Kudos
Message 2 of 3
(3,298 Views)
Hi Archimedes,

Aha, I see now. I'll play around with it some and post anything new. No sonograms though. We're trying to determine the baby's head shape very precisely using optical equipment, without interference from the hair. Rather difficult. Mommas don't appreciate their kids getting a shave.
0 Kudos
Message 3 of 3
(3,298 Views)