   can't render opengl function
  Reading GLUT Tutorial -INITIALIAZTION- from site WWW.lIGHTHOUSE3D.COM.  The foll. code from the site shows how   GLUT initializes and renders.  The code works but I first tried this renderScene function code, void renderScene(void){glClear(GL_COLOR_BUFFER_BIT);// Draw a triangleglBegin(GL_LINE_LOOP);glVertex2i(200, 200);glVertex2i(300, 50);glVertex2i(100, 400);glEnd();glFlush();}which gives just a black window.  Would like to know why.I observe that the working code uses glBegin(GL_TRIANGLES);   WORKING CODE#include <gl/glut.h>#includevoid renderScene(void) {glClear(GL_COLOR_BUFFER_BIT);glBegin(GL_TRIANGLES);glVertex3f(-0.5,-0.5,0.0);glVertex3f(0.5,0.0,0.0);glVertex3f(0.0,0.5,0.0);glEnd();glFlush();}void main(int argc, char **argv) {glutInit(&argc, argv);glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE |GLUT_RGBA);glutInitWindowPosition(100,100);glutInitWindowSize(320,320);glutCreateWindow("3D Tech- GLUT Tutorial");glutDisplayFunc(renderScene);glutMainLoop();}-X 
  Well, the numbers that you are using are way too big.  Your triangle is way off somewhere in the screen... ;  Thanks for helping.  I changed window size to 640, 480 and reduced size of triangle but still don''t get drawing. My Vertices are integers (Vertex2i) because of, glBegin(GL_LINE_LOOP);-Y ;  Since you''re not setting the projectio matrix, you  get the default one, which is the identity matrix. This gives you a vuiew volume in the form of a cube which ranges from -1 to 1 along all axes. Your trignales has coordinates way outside this cube.The size of this cube has nothing to do with the size of the window. Either change the coordinates in you line loop to fit inside the range [-1, 1] or set the projection matrix to match the size of the window. Something like this.glOrtho(-0.5, window_width-0.5, -0.5, window_height-0.5, -1, 1);;  Thanks to both bOb and Bob.  I got the output by modifying the LINE_LOOP vertices to use logical coordinates and also by setting the projection matrix to match the window dimensions -Y   [edited by - yoho on February 14, 2004 3:39:53 PM]