I decided to have a try at an OpenGL program. I used Dev-C++ to generate a Win32 shell for an OpenGL program and it compiled fine etc.
Next I took Blender (www.blender3d.org) and added a cone mesh to a blank scene, then I did File > Export > Raw Triangle. Now I have this Raw Triangle file that looks like so:
-0.000001 -0.000001 -1.414214 0.135953 0.027043 -1.407404 0.138616 0.000000 -1.407404
(this is one line of many).
Finally, I wrote some C++ code to parse the file. It takes each line and throws it into a vector<double>. I take the vector and use it like an array:
glColor3f(1.0, 0.0, 0.0);
glVertex3f(vf[0], vf[1], vf[2]);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(vf[3], vf[4], vf[5]);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(vf[6], vf[7], vf[8]);
When I render this I get tons of little triangles all over the screen. Any idea why it’s not a cone? Also, how come the numbers are always very small?