LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I will do a small software that plot a 2D function curve use openGL , feasible ?

Solved!
Go to solution

1,  I have a lot of sample data, it can be plot a 2D dot distribution map.

openGL 01.jpg

 

2, then, I need fit a function curve,such as:

openGL 02.jpg

 
3,then , I need got the point of intersection coordinate (x0, y0)
openGL 03.jpg
 
4,then if I can create a vertical line on X axis what it can to left or right free move by mouse,
then I can got other point coordinate,such as (x1,y1) and (x1,y2)
openGL 04.jpg
 
5, even  I can also get a function formula ,such as f1(x) and f2(x).
openGL 05.jpg
 
Would you please give me a little suggest ?
 
Thanks a lot !
 
0 Kudos
Message 1 of 6
(4,999 Views)
Solution
Accepted by topic author cnchip

CVI can use OpenGL functions: there is a specific OpenGL instrument located in <CVIfolder>\toolslib\custctrl\cviogl.fp. There is also an example program that makes use of OGL functions to plot 3D sufraces: see the code in <CVISampleFolder>\apps\oglscxi fodler.

 

Having said this, since you are dealing with 2D plots, do you really need OpenGL? All the steps you have listed above could be addressed with standard CVI functions: as an example you can use a properly formatted PlotXY () call to plot curves as in step #1, PolyFit () to calculate the interpolant in step #2 (which also goves you the formula as in step #5) and cursors to do plot searching as in step #4.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(4,977 Views)
Thank you very much for your suggest and reply. If use PlotXY() to plot curves, it can free move and zoom in and out based mouse ? I have been looking for some example. Thank you again.
0 Kudos
Message 3 of 6
(4,942 Views)

Thank you again.

I will give up openGL, that is too complicated.

Would you please help me on the other question ?

http://forums.ni.com/t5/LabWindows-CVI/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%B8%8D%E8%83%BD%E7%BC%...

 

 
0 Kudos
Message 4 of 6
(4,909 Views)

Yes, I have just answered there Smiley Happy



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 6
(4,907 Views)
Thank you again. Exhilarating...:smileyvery-happy:
0 Kudos
Message 6 of 6
(4,904 Views)