Qt3D, how can i rotate mesh at centre?



  • Entity {
        id: sceneRoot
    
        Camera {
            id: camera
            projectionType: CameraLens.PerspectiveProjection
            fieldOfView: 90
            nearPlane : 0.1
            farPlane : 1000.0
            position: Qt.vector3d( 0.0, 0.0, 40.0 )
            upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
            viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
        }
    
        OrbitCameraController { camera: camera }
    
        components: [
            RenderSettings {
                activeFrameGraph: ForwardRenderer {
                    camera: camera
                    clearColor: "transparent"
                }
            },
            InputSettings { }
        ]
    
        PhongMaterial {
            id: material
        }
    
        Mesh{
            id: mesh
            source: "AIM-9.obj"
        }
    
        Transform {
            id: meshTransform
            scale: 0.2 
            rotation: fromEulerAngles(0, 0, 0)
        }
    
        Entity {
            id: torusEntity
            components: [ mesh, material, meshTransform ]
        }
    

    I set the rotation with using Transform rotation and set roll, pitch, yaw. But if i try to roll that, it is not roll at the centre. There is a distance difference between. How can i roll it at centre?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.