PDA

View Full Version : help in glEval &glMap



marysowdha
11-13-2001, 11:20 AM
Hi
Can somebode tell why the code does not draw anything???????
#include <GL/glut.h>
GLfloat controlpoints[4][3]= {{-1.0,1.0,0.0},{0.0,0.0,0.0},{1.0,1.0,0.0},{2.0,4.0, 0.0}};
GLfloat adjcontrolpoints [4][3]= {{-1.0,-1.0,0.0},{0.0,0.0,0.0},{1.0,1.0,0.0},{2.0,8.0,0.0} };
void display()
{
inti ; glClear(GL_COLOR_BUFFER_BIT);
int plotpoint = 100;
glMap1f(GL_MAP1_VERTEX_3,0.0,1.0,3,4,&adjcontrolpoints[0][0]);
glBegin(GL_LINE_STRIP);
for (i = 0;i<=plotpoint;i++)
glEvalCoord1f((1.0*i)/plotpoint);
glEnd();

}
void init()
{
glClearColor(1.0,1.0,1.0,1.0);
glColor3f(0.0,0.0,0.0);
glEnable(GL_MAP1_VERTEX_3);

}
void reshape(int w,int h)

{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-4.5,4.5,-4.5,4.5,-4.5,4.5);
glMatrixMode(GL_MODELVIEW);

}


void main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("homework9-1");
glutDisplayFunc(display);
init();
glutReshapeFunc(reshape);

glutMainLoop();
}