Here is code which is not displaying I would like to render the vertices described below.
Where is the problem
#include <GL/glut.h>
#include <GL/gl.h>
static float v[6][3] = { {-1.0f,0.0f,2.0f},
{1.0f,0.0f,2.0f},
{-1.0f,0.0f,-2.0f},
{0.0f,2.0f,1.0f},
{0.0f,3.0f,-1.0f},
{0.0f,3.0f,2.0f},
};
void init()
{
glShadeModel(GL_FLAT);
glClearColor(1.0f,1.0f,1.0f,1.0f);
}
void reshape(int w,int h)
{
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//gluPerspective(45, 1, 1, 10000);
gluOrtho2D(0.0,(GLdouble)w,0,0,(GLdouble)h);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
//gluLookAt(0.0f,0.0f,5.0f,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f);
glBegin(GL_POINTS);
for(int i=0;i<6;i++)
{
glVertex3dv(&v[i]);
}
glEnd();
glFlush();
}
int main(int argc,char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(700, 700);
glutInitWindowPosition(0, 0);
glutCreateWindow("glCloth");
init();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutMainLoop();
return (0);
}