Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Having problems with custom color maps on 3D graphs.

My app has 4D data consisting of 3D position and an error
value for each point. I'm trying to color code this error using a custom
color map.

I could not get the expected results so I worked some test cases.

Using the point PlotStyle, I set a custom color map with two colors (e.g.
black = 0 and white = 600) encode my error value (w parameter to 3D graph)
with the array index, I see my data smoothly transition from black to
white. If I make it a bit more complex (color map with 3 values) it no
longer appears to work. The mapping appears to be off by one index. (I
do not have the cache data option checked)

I get the same results regardless of whether I hardcode the color/value
settings in the pr
operty editor or if I use ColorMapValues and
ColorMapColors members of the 3D graph object.

What is the behaviour of the 3D graph's color maps? What is the resolution
of the color map? Are the values stored in the 3D graph cached at lower
resolution (double,float,int)?

Any help would really be appreciated because this tool seems perfect for my
app with this one exception.
0 Kudos
Message 1 of 7
(5,088 Views)
Just to get started, I highly recommend looking at the "Color Map Styles" example program located in your C:\Program Files\National Instruments\MeasurementStudio\VC\Examples\Ui\Graph3D\Color Map Styles installation folder. It demonstrates quite nicely exactly what you are asking about. I have also included it with this post just in case you no longer have it. Make sure to pay special attention to the SetCustomColorMap() function in the example, because this is where they set up the number and type of colors to be displayed in the graph.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
Message 2 of 7
(5,089 Views)
Thanks for the sample code. It turns out that my install of MS does not have that sample. Here is the listing of my sample code:

C:\Program Files\MeasurementStudio\VC\Examples\UI\Graph3D>dir
Volume in drive C has no label.
Volume Serial Number is 5C0A-F596

Directory of C:\Program Files\MeasurementStudio\VC\Examples\UI\Graph3D

12/04/2001 07:32a .
12/04/2001 07:32a ..
12/07/2001 07:53a Axis
12/07/2001 07:53a Contours
12/07/2001 07:53a Events
12/19/2001 06:44a Plot Styles
12/07/2001 07:53a Region Of Interest
12/07/2001 07:53a Spinning Light
12/07/2001 07:53a
Transparency
0 File(s) 0 bytes
9 Dir(s) 22,692,454,400 bytes free

I also grepped for the ColorMap funciton names that I knew and couldn't find them.

This should help a lot.

Chuck
0 Kudos
Message 3 of 7
(5,088 Views)
I tried to run your sample code and it won't compile. The header files:

#include
#include
#include
#include
#include

do not exist on my install of MeasurementStudio. I am a bit suspicous that I don't have the latest and greatest (loading the dialong resouce gave version warnings). Here is one of my header file headers:

//==============================================================================
//
// Title : NiAxes3d.h
// Copyright : National Instruments 1999. All Rights Reserved.
// Purpose : Defines the CNiAxes3D class.
//
//==============================================================================

I
looked on your updates site and don't really see an update that applies to ComponentWorks or MeasurementStudio. My version per the MAX program for 3DControls is 3.5.549.

Do I need a newer version? What do I have to do to get the updated version? What does it cost?

Chuck
0 Kudos
Message 4 of 7
(5,088 Views)
Dear Jason
 
If i want to draw lines in 3d plot using curve plot, can i change the color of each line that i drew,
for example if i draw 5 consecutive lines using points, can i change the color of each line that connects the point.
And can i put a custom label in each point, which always follow the point where ever it goes?
 
thanks
-Just a student-
0 Kudos
Message 5 of 7
(4,726 Views)
Hi Nandha,
 
Thank you for your post. Though the exact implementation may be different depending on which language you are programming in, you should be able to view your 3D graph line in multiple colors using the color map feature. Specifically, you can use the SetColorMapStyle method and set the style to ColorSpectrum or Custom in order to accomplish this.
 
At the current time, the CWGraph3D control does not allow adding annotations (the CWGraph control does). Therefore, I do not think there is an easy way to place a custom label on each point plotted.
 
I hope this helps!
 
Regards,
 
Casey Weltzin
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(4,712 Views)

Yes, using label in each point would be difficult,

but , i solved the problem using only color though

thanks a lot

-Just a student-
0 Kudos
Message 7 of 7
(4,707 Views)