Hello,
I want to show you what I m doing in Gluon Graphics and I m
waiting for your suggest
GluonGraphics::Vertex represents a 3d point
It contains x,y,z, QColor, textureX, textureY .
GluonGraphics::Transform represents a transformation Matrix
it contains a QMatrix4x4 and contains many methods like :
setRotate, setPosition ....
GluonGraphics::Mesh represents an object to show.
It contains a VertexList, and many methods to create primitiv
shape. For example : createBox, createCircle , createPlane ....
GluonGraphics::Item : has a mesh and a Transform class. This
class can paint the mesh and apply transformation to openGL.
Now the question : How Can I split 2d function and 3d function...
First solution :
Keep one class for 2d and 3d.
Example :
Transform::setPosition( float x, float y, float z=0);
item->setPosition(x,y);
item->setPosition(x,y,z);
Mesh::createRect( QRectF )
Mesh::createCone(radius, width....)
2nd solution :
2d and 3d class inherits from one
Example :
Transform2d::setPosition(float x, float y);
Transform3d::setPosition(float x, float y, float z);
Mesh2d::createRect()
Mesh3d::createCone()
3th Solution :
1 global class for transformation and 2 for mesh :
Transform::setPosition(float x,float y, float z=0);
Mesh2d::createRect(QRect);
Mesh3d::createBox(....)
I this the solution 3 is the best. So I m waiting now for your
suggest