The f is just an explicit hint that the literal is float (as opposed to double), but most compilers are smart enough to know that if you are assigning a floating point literal to a float variable, even if it doesn''t have the f qualifier, it''s still a float, not a double. Shouldn''t be a problem.
As for your triangle class, it will certainly work, but it probably isn''t the best way. Optimal performance in drawing geometry is not accomplished through immediate mode calls (sequences of glVertex() calls) using individualized variables, but rather through drawing from arrays of vertex data, which can also be compiled into vertex buffers for possibly increased performance. Even if you continue to use immediate mode calls, it would probably be best to do so from arrays of vertex data, especially the more geometry you must process.
Geometry handling in general is handled best through arrays of vertex data, rather than as individualized, separately named variables such as point1x, point1y, etc... Compress such data into an array of vertices, to facilitate loading and manipulation.
Using arrays of vertex data enables you to load, render, transform, etc... in batches using operations that handle arrays, rather than having to feed the data to the operation one variable at a time.
Vertex data represented as arrays can be handled in 2 basic formats: interleaved or non-interleaved. In an interleaved representation, each vertex is represented by an aggregate (structure or class) that contains all relevant vertex data, maybe something like:
struct Vertex{ float x,y,z; float r,g,b; float u,v;};
A single triangle, then, could be comprised of an array of Vertex:
struct Triangle{ Vertex Points[3];};
Then, for example, if you have to load a triangle from a file the operation become a simple iteration through the array, loading each vertex, rather than a more complex operation of loading each individual point component. Also, drawing is as simple as setting the array using glInterleavedArrays() to set the array as your source.
Non-interleaved arrays store each component of a vertex (vertex, color, texture coords, etc...) as separate arrays, and specify the component sources using glTexCoordPointer, glVertexPointer, etc... There is actually very little difference between the two methods, though there may be performance differences between cards, depending on quality of interleaved support.
Even this isn''t optimal for meshes composed of triangles, since it encapsulates a triangle into a unit, and triangles which share edge data each maintain their own local copy of shared vertex data, increasing the number of redundant transformations needing to be performed per vertex. An even better method is to maintain an array that holds all unique vertices in the entire mesh, and triangles are drawn in batches using glDrawElements() or glDrawArrays(). Individual triangles then, rather than maintaining a local copy of a vertex''s data, maintains instead an index into the list of vertices. This way, vertices can be manipulated and stored only once, but shared among many triangles.
I recommend that you should try to organize your vertex data so that it can be manipulated very rapidly in batches, large chunks at a time. Breaking it up into individual point1, point2 type variables is not the best way of doing so.
Just my opinion...
GolemBlender--
The Gimp--
Python--
Lua--
SDLNethack--
Crawl--
ADOM--
Angband--
Dungeondweller