Opengl Function

Can someone give the code in opengl for a function like: x^2+1 ? I just want to get an example and see what it should look like.

Huh? What has this to do with OpenGL?
y = x * x + 1;

Ah, read the other post. You want to display the functioin as a drawing with the help of OpenGL?

Pretty easy. This plots a 2D line graph:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(start, end, min(star * start + 1, end * end + 1), max(star * start + 1, end * end + 1), -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity()
glBegin(GL_LINE_STRIP);
for (x = start; x <= end; x += increment)
{
glVertex2f(x, x * x + 1);
}
glEnd();

Is that what you wanted?

[This message has been edited by Relic (edited 02-26-2001).]