Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. The texture does not repeat on 3d model

The texture does not repeat on 3d model

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 449 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vladimir Sazonov
    wrote on last edited by
    #1

    I have .obj model of wheel. In the viewer it loads and looks correct.
    When I load this .obj model throuth SceneLoader all righth, but there are only fragment of tyre protector texture.
    Texture does not repeated. How do I set up the renderer so that the texture repeats?

    My code:

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    
    import QtQuick.Scene3D 2.0
    import Qt3D.Core 2.0
    import Qt3D.Render 2.0
    import Qt3D.Input 2.0
    import Qt3D.Extras 2.0
    
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
    
        Rectangle {
            id: scene
            anchors.fill: parent
            anchors.margins: 0
            color: "darkGray"
    
            Scene3D {
                id: scene3d
                anchors.fill: parent
                anchors.margins: 0
                focus: true
                aspects: ["input", "logic"]
                cameraAspectRatioMode: Scene3D.AutomaticAspectRatio
                visible:true
    
                Entity {
                    id: sceneRoot
                    Camera {
                        id: camera
                        projectionType: CameraLens.PerspectiveProjection
                        fieldOfView: 45
                        nearPlane : 0.1
                        farPlane : 1000.0
                        position: Qt.vector3d( 0.0, 0.0, 2.0 )
                        upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
                        viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
                    }
    
                    FirstPersonCameraController { camera: camera }
    
                    components: [
                        RenderSettings {
                            activeFrameGraph: ForwardRenderer {
                                camera: camera
                                clearColor: "transparent"
    
                            }
                        },
                        InputSettings { }
                    ]
    
    
                    SceneLoader
                    {
                       id: wheelMesh
                       source: "qrc:///disk_g.obj"
    
                    }
    
                    Transform {
                        id: wheelTransform
                        property real userAngle: 70
                        matrix: {
                            var m = Qt.matrix4x4();
                            m.rotate(userAngle, Qt.vector3d(0, 1, 0))
                            m.translate(Qt.vector3d(0, 0, 0));
                            return m;
                        }
                    }
                    DirectionalLight
                    {
                        id: wheelLight
                        worldDirection: Qt.vector3d(0, -0.707, -0.707)
                        color:"White"
                        intensity: 1.0
                    }
    
                    DirectionalLight
                    {
                        id: wheelLight1
                        worldDirection: Qt.vector3d(0, 0.707, -0.707)
                        color:"White"
                        intensity: 1.0
                    }
    
                    Entity {
                        id: sphereEntity
                        components: [ wheelMesh, wheelLight, /*wheelLight1,*/ wheelTransform ]
    
                    }
    
                }
            }
        }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved