PDA

View Full Version : graphing data



link19
12-07-2000, 04:43 AM
Anyone know of some good examples of drawing graphs in an opengl window? Im developing in VC environment.
Thanx for any help

jc
12-07-2000, 05:58 AM
To draw a graph in an opengl window, use the glortho function.
U can draw axis with lines and u'r graph is a list of vertex2f that u join thanks to GL_LINES

HOpe it wil help

link19
12-07-2000, 07:18 AM
Thanx jc. But a hard coded line on the graph is kind of useless...wondering if an opengl app can graph in real time??

Glossifah
12-07-2000, 07:33 AM
Hard coded? Don't use literal constants when you call glVertex2f(). Put in some variables and then any changes you make to those variables occur immediately.

Glossifah

Dave007
12-07-2000, 09:10 AM
If you want to draw mathematic function in real time you must code function parser for it!! the you can draw graphs!!

bobmarley4u2c
12-21-2000, 07:14 AM
Just being curious, how do you do the code for the Grapher (function grapher).

Toom
12-21-2000, 08:39 AM
About six years ago I released an expression parser/evaluator that is completely free and open (use it in any way you see fit). It's in C and is easily incorporated into other programs. You could use this to allow user-entered formulae that you would then graph. It supports function calls (sin, cos, tan, etc), variables, and constants.

ftp://ftp.islandnet.com/Mark_Morley/ee.zip

Mark

[This message has been edited by Toom (edited 12-21-2000).]