   read vertices from file and render the object
  Hey guys, i want to render a 3D object by reading all its vertices from file.the file is in the form of :1.3   2.1   3.2-0.3  2.7  -3.8etc.   can u suggest me any idea, thanks   
  You failed to specify which language you're using, so I'll just assume C, C++C stylefloat x,y,z;FILE* fp = fopen(mesh.obj);fscanf(fp, "%f %f %f", &x, &y, &z); orC++ stylefloat x,y,z;ifstream infile(mesh.obj);infile >> x;infile >> y;infile >> z   ;  sorry for that, am using VC++here is the code fragment:double x,y,z;ifstream f;f.open("file.txt");f>>x>>y>>z;glBegin(GL_TRIANGLES);while(!f.eof()){  glVertex3d(x,y,z);  f>>x>>y>>z;}glVertex3d(x,y,z)f.close();glEnd()This code works fine for the data below:10 -10 00 -10  010 10  0but i got black screen when i change the value of z (vlaue of the last column)i.e: 10 -10 100 -10 1010 10 10?   ;  1. You haven't provided enough information for us to know why the second triangle doesn't render, but my guess is that it's because it's behind the camera (remember, in its default orientation the OpenGL 'camera' points down the -z axis).2. Don't use open() and close(); instead, open the file in the constructor and let it close itself when it goes out of scope.3. You probably don't want to be doing file IO inside an inner rendering loop. Consider reading the vertex data from the file, storing it in an array, and then rendering from the array.   ;  Ok, i wrote a code which displays an image on the screen using VC++ and OpenGL by reading (x,y,z) cordinates, each pixel, from file. But i didn't get clear image as i expected. So, can i use ray tracing algorithm to get clear scene? do u have any idea how to use it?Thanks,   