Is it possible to translate a QML Rectangle on the Z axis similar to how we can do in HTML with CSS transform:translateZ()
and transform:translate3d()
?
Applying transform: Translate {x: 0; y: 0; z: 100}
on a Rectangle throws an error that the z property isn't defined.
I am able to apply transform: Rotation{}
to a Rectangle with a z-axis rotation and it looks 3D. I was hoping I could translate things in 3D as well.
Is there a way to do it?
EDIT: I tried setting a Matrix4x4 like this:
transform: Matrix4x4 {
matrix: Qt.matrix4x4(
1,0,0,0,
0,1,0,0,
0,0,1,10,
0,0,0,1
)
}
I set the number 10
where I believe the Z translation is, but the Rectangle just disappears instead of getting a little closer to the camera.