Pleasant Hill, MO
Output wont show up on screen. Using openGL, HELP PLEASE!
I can't get the output of what code, or at least as far as I can tell what should be the output, to show up on my screen. Would anyone be able to help me?
I'm trying to do something out of a book I got, it says the formula I shoud use is: "the x coordinate is driven by the parameter a and is given by x(a) = 10 + sin(15 * a) as a varies from 0 to 2PI. The y cordinate is given by y(a) = sin(a), and varies over the same range."
Its supposed to make a squiggly circle but it just comes up with a blank window. Any help would much appreciated.
EDIT: I suppose I should give some info about what I'm using. I'm using the latest version of freeglut, and the latest code::blocks ide. I know its old code(like opengl 1 or something from what my friends have said when they looked at the code). Its for a class, otherwise I'd be learning at least opengl 3.0 instead of this.
for the "for" loop in the myDisplay routine, you'll need set braces around the x=, y=, and glVertex2d statements. Right now only the x= is executed as part of the loop.
Also, adding 10 in the x= statement causes the x coordinate to exceed the bounds of the gluOrtho2D. Lowering that to 5 will get some sort of display on the screen, although it still might not be what you want.