3d Graphing Program

Hello, I’m trying to make a 3d graphing program, but I’ve ran into a little snag. I an’t seem to fix one of the littler problems, the graphing itself. I have it set so a user can enter a formula, and if my math parser works, graph. The program gives an exact approximation of the vertices, and then puts garbage on my screen. I want to see a bunch of irregular tetragons, like on a Ti-89 calculator, but none of my quads are connected. Other than that, it forms the shape accurately enough. Eventually this will have polar, function, 3d-polar, parametric, and differential equations. I have riemann sums working well enough, but the actual graphs just sucks. I have (of course) x,y, and z coordinates in a large array, and would appreciate any help with with plotting code. Thanks!


You won’t get the answer you’re looking for by posting in this manner. You need to pare down your problem-code to show just what’s relevant here, and post that. You might also describe what a tetragon is (I’ve never heard of it anyway). Further, if you’ve got some web page space from your ISP, you might even post a link to a screenshot of what you’re output looks like.

Good luck.

Well, I figured out how to get all of the vertices into an array and to draw a good graph. It will graph with lines and irregular tetragons (A figure with four non-congruent sides.) Now I’ve encountered a new problems. The user can input the xmin, xmax, ymin… variables, the resolution of the grid, and a formula. I can get the window to size itself with glOrtho, but I can’t seem to get that to work with other GL commands that rotate the graph so you can view it at an angle. When I use things like glRotatef, it appears to (eventually) become asymptotic to something, as it begins to go back and forth rapidly. As for actual code, all I need is someway to use glOrtho in conjunct with something like gluLookat or whatever. My mouse-rotate code is really messed up, but for now I’ll assume I can fix that with OpenGL tutorials that I’ve seen. Thanks.