How to rotate/flip a texture in Qt3d C++
Unsolved
Game Development
-
Hi there,
is there a way to flip/rotate a texture in Qt3D. From my code:
auto textureImage = new Qt3DRender::QTextureImage; QString fileurl = "file:/path/to file"; textureImage->setSource(QUrl(fileurl)); auto planeImage = new Qt3DRender::QTexture2D(); planeImage->addTextureImage(textureImage); auto cylinderMaterial = new Qt3DExtras::QDiffuseSpecularMaterial(); cylinderMaterial->setTextureScale(1.); cylinderMaterial->setDiffuse(QVariant::fromValue(planeImage));
I am looking for something like "textureImage->setRotation" or "textureImage->setTranslation"
or the same for "planeImage" or "cylinderMaterial" ... does it exists ? I could not find this in the documentation.Alexander
-
https://doc.qt.io/qt-5/qt3drender-qtextureimage.html#setMirrored
Otherwise you're probably looking for this:
https://doc.qt.io/qt-5/qt3drender-qpaintedtextureimage.html -
@kshegunov thx for your hints. Both classes do not offer what I am looking for.
"setMirrored" is half the way. It Would need a "horizontal" or "vertical" option on top.
I am looking for something like:
textureImage->setRotation( 0-380°); or cylinderMaterial->setOrientation( 0-380°);