I don't know if you'll be able to do what you want with Plot3DCurve. I think that Plot3DSimpleSurface or Plot3DSurface is what you're looking for. Below is an example that demonstrates how to get a color spectrum intensity plot of a dual sine surface plot that is similar to the plot that is displayed at design-time. To run this example, create a new Measurement Studio for Visual C++ project, add a graph to the dialog, create a member variable for it called m_graph3D, and add the code below to the dialog's OnInitDialog method:
// Configure a top-down view of the surface and zoom in on the plot a little.
m_graph3D.ViewMode = CNiGraph3D::ViewXYPlane;
m_graph3D.ViewDistance = 0.7;
// Configure the plot for a color spectrum surface
plot.
CNiPlot3D plot = m_graph3D.Plots.Item(1);
plot.Style = CNiPlot3D::Surface;
plot.ColorMapAutoScale = false;
plot.ColorMapInterpolate = true;
plot.ColorMapLog = false;
plot.ColorMapStyle = CNiPlot3D::ColorSpectrum;
// Generate the dual sine surface data.
const int SIZE = 41;
CNiReal64Vector xData(SIZE);
CNiReal64Vector yData(SIZE);
CNiReal64Matrix zData(SIZE, SIZE);
int i, j;
for (i = 0; i < SIZE; ++i)
xData[i] = yData[i] = ((i - 20.0) / 20.0) * CNiMath::Pi;
for (i = 0; i < SIZE; ++i)
{
for (j = 0; j < SIZE; ++j)
zData(j, i) = sin(xData[i]) * cos(yData[j]) + 2.0;
}
// Plot the data.
m_graph3D.Plot3DSurface(xData, yData, zData);
When you compile and run you should see a result like the attached screenshot. Please reply with more information if this does not demonstrate what you're trying to do.
- Elton