0

I have curve, a parable (y=x*x) for x in [0, 10]. I have used:

glOrtho(-10 - 3, 10 + 3, -(y(10)+ 3) * (GLfloat) h / (GLfloat) w,
                        (y(10) + 3) * (GLfloat) h / (GLfloat) w, -1, 1);

a part on top is clipped. Moreover if I consider a parable in [8, 10] and I set:

glOrtho(-10 - 3, 10 + 3, -(y(10)+ 3) * (GLfloat) h / (GLfloat) w,
                        (y(10) + 3) * (GLfloat) h / (GLfloat) w, -1, 1);

my curve disappears from the scene. How can I modify the commands to visualize the curve?

willie
  • 39
  • 1
  • 5
  • @ httpdigest Clearly y(10)=10^2, I am talking about a parable. So in opengl I am referring to evaluate the function at the point 10. A parable in [0, 10] means that I draw with a polyline the curve with a set of point with x-coordinate from 0 to 10. – willie Jan 06 '21 at 13:37
  • Can you please show a picture? – new Q Open Wid Jan 06 '21 at 15:42
  • My window is even completely without the curve in case of an intterval of type [-10, -8]... – willie Jan 07 '21 at 07:05

0 Answers0