[ Thread Index |
Date Index
| More lists.tuxfamily.org/gluon Archives
]
- To: gluon <gluon@xxxxxxxxxxxxxxxxxxx>
- Subject: [gluon] Gluon Graphics
- From: idk <istdasklar@xxxxxxxxx>
- Date: Fri, 26 Feb 2010 12:43:03 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=UDrON2eNfQu1Txz3+3ltDofjvqvNgf3H5SzOUgukM30=; b=LXxcVK8Fimdig7DNxDwp/xqoctM8orm4loztyuCX0ADOEi3p4HmOQjZf6dgAmC8ObE wV9n9UzpiKUXbYXKIlD0iJVDK5ElGgi6dC8RlFQtF9KLxCMZ0TwtBA/yR1ge7T8r7mlq cr/HBFBi7+vkaUAYGy5nh8F8Zr97sJBeeSGr0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TYmy6/mOYKcC6KhhqclPYBe/kCOeq74GdKVHDM41iNWNQaIDPnlBqp2GFMfMkuIetS 91gylIH2uqVhY+5VSjO1wzR2ktfIiO5cdrwFgkWTH/elJAEBYMg4zVpdBDX3ued4q0Qb UqUR8RiZLOOful4RNRNWdnVJQM214ujhdx1qg=
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