01-26-2010 03:02 PM
I have taken over part of a project for someone and am trying to figure out this code. I have a 3D array and am plotting in spherical coordinates. however, no matter what I set the 3D graph to, it always just plots points.
Plotting code:
CA_VariantSet1DArray (&var_theta, CAVT_DOUBLE, cell_cnt, &theta_array); CA_VariantSet1DArray (&var_phi, CAVT_DOUBLE, cell_cnt, &phi_array); CA_VariantSet1DArray (&var_mag, CAVT_DOUBLE, cell_cnt, &mag_array); GetObjHandleFromActiveXCtrl (panel_handle, VIEW_3DGRAPH, &threeDgraphHandle); CW3DGraphLib__DCWGraph3DGetPlots (threeDgraphHandle, NULL, &threeDplotsHandle); //What are these lines doing?
CW3DGraphLib_CWPlots3DItem (threeDplotsHandle, NULL, CA_VariantInt(1),&threeDplotHandle); //What are these lines doing
CW3DGraphLib__DCWGraph3DPlot3DCurve (threeDgraphHandle, NULL, var_phi, var_theta, var_mag, CA_DEFAULT_VAL);
The Ring that sets the plots to something different is below:
int CVICALLBACK GRAPH_RING (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int style; switch (event) { case EVENT_COMMIT: //Set Plot Style to selected mode GetCtrlVal (panel_handle, VIEW_GRAPH_RING, &style); switch (style) { case 0: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwLine); break; case 1: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwPoint); break; case 2: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwLinePoint); break; case 3: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwHiddenLine); break; case 4: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwSurface); break; case 5:; CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwSurfaceLine); break; case 6: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwSurfaceNormal); break; case 7: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwContourLine); break; case 8: CW3DGraphLib_CWPlot3DSetStyle (threeDplotHandle, NULL, CW3DGraphLibConst_cwSurfaceContour); break; } break; } return 0; }
I have tried using the .. _CWPlot3DPlot3DCurve and surface and what not but I get the no graph at all.
The biggest problem is I cannot find any examples (and couldn't use Find Examples > From NI because it said server failure) nor is it documented very well.
Thanks in advance.
01-27-2010 05:02 PM
Hi Ngay528,
There is actually an example demonstrating this, located here:
C:\Documents and Settings\All Users\Documents\National Instruments\CVI90\samples\userint\activex\3DGraph.cws
Let me know if you are still having problems!
01-29-2010 03:51 PM
I have looked through all examples but still remain with my problem. I believe the problem resides in limitations with line styles with different plots. I am currently plotting a 3DCurve. Because it is a curve, are there restrictions on what type of line style?
If i need to plot a different style (contour, surface), I may need help doing that since I have 3 arrays that go with each point as you can see above.
Graphing in spherical coordinates I have theta, phi and magnitude. in addition, there are multiple points (different magnitudes) at the same phi,theta points.
My main goal is to plot the datapoints and show different magnitudes by color. A contour graph would work, but not sure how to graph that, nor am sure if its possible with criss crossing curves.