{x,y,z}Rotation property of QGraphicsItem has gone?
Hi,
i wonder if anyone knows what happened with a great facility described at QT Blog http://labs.trolltech.com/blogs/2009...spin-on-things
It looks like {x,y,z}Rotation property of QGraphicsItem won't reach Qt release - code from blog does not work both with 4.6-stable and trunk.
Is there any other technique you can advise to rotate QGraphicsItem instead of yRotaion + QPropertyAnimation? Is it only QGraphicsRotation + QTimeLine?
Thanks,
- Giga
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
It rotates item around z-axis, while i need either x- or y-axis rotation. That is what {x,y,z}Roration property about.
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Quote:
Originally Posted by
Giga
It rotates item around z-axis,
This is true.
Quote:
Originally Posted by
Giga
while i need either x- or y-axis rotation
If you want a 3D rotation, you can use OpenGL.
Rotation in OpenGL is accomplished through the glRotate*() function, which is defined as:
Code:
void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
So you can provide the axis of rotation.
You can even try it for Qt 4.6 technology preview is released.
http://qt.nokia.com/developer/qt-4.6-technology-preview
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Right. glRotate*() rotates GL content, but not entire widget.
What i need is to rotate an item in graphics scene.
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Quote:
Originally Posted by
Giga
It rotates item around z-axis, while i need either x- or y-axis rotation. That is what {x,y,z}Roration property about.
QGraphicsItem::setTransform() and QTransform::rotate().
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Quote:
Originally Posted by
wysota
QTransform class specifies 2D transformations of a coordinate system.
Re: {x,y,z}Rotation property of QGraphicsItem has gone?
Quote:
Originally Posted by
yogeshgokul
QTransform class specifies 2D transformations of a coordinate system.
So? Is your monitor 3D? OpenGL does 2D transformations as well. Sometimes it is worth reading more than just the first sentence of the docs.
"QTransform differs from QMatrix in that it is a true 3x3 matrix, allowing perspective transformations".