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. I want to create a scene like in 3D builder
Forum Update on Monday, May 27th 2025

I want to create a scene like in 3D builder

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3d canvasscene3d
1 Posts 1 Posters 258 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.
  • T Offline
    T Offline
    timob256
    wrote on 10 Nov 2021, 11:16 last edited by timob256
    #1

    I want as in the picture

    Screenshot_20211115_125316.png
    Screenshot_20211115_125303.png

    I get it like this
    Снимок экрана от 2021-11-10 08-18-37.png

    here is the code :

    import QtQuick 2.1 as QQ2
    import Qt3D.Core 2.0
    import Qt3D.Render 2.0
    import Qt3D.Input 2.0
    import Qt3D.Extras 2.0
    
    Entity {
        id: sceneRoot
    
        Camera {
            id: camera
            projectionType: CameraLens.PerspectiveProjection
            fieldOfView: 45
            aspectRatio: _window.width / _window.height
            nearPlane: 0.1
            farPlane: 1000.0
            position: Qt.vector3d(0.0, 10.0, 20.0)
            viewCenter: Qt.vector3d(0.0, 0.0, 0.0)
            upVector: Qt.vector3d(0.0, 1.0, 0.0)
        }
    
        FirstPersonCameraController { camera: camera }
    
        ShadowMapLight {
            id: light
        }
    
        components: [
            ShadowMapFrameGraph {
                id: framegraph
                viewCamera: camera
                lightCamera: light.lightCamera
            },
            // Event Source will be set by the Qt3DQuickWindow
            InputSettings { }
        ]
    
        AdsEffect {
            id: shadowMapEffect
    
            shadowTexture: framegraph.shadowTexture
            light: light
        }
     
        // Plane entity
        GroundPlane {
            material: AdsMaterial {
                effect: shadowMapEffect
                diffuseColor: Qt.rgba(0.5, 0.5, 0.5, 1.0)
    //            specularColor: Qt.rgba(0, 0.5, 0, 1.0)
    
            }
        }
    }
    

    GroundPlane.qml

    import Qt3D.Core 2.0
    import Qt3D.Render 2.0
    import Qt3D.Extras 2.0
    
    Entity {
        id: root
        property Material material
    
        PlaneMesh {
            id: groundMesh
            width: 50
            height: width
            meshResolution: Qt.size(2, 2)
        }
    
        Transform {
            id: groundTransform
            translation: Qt.vector3d(0, -5, 0)
        }
    
        components: [
            groundMesh,
            groundTransform,
            material
        ]
    }
    

    how to make a chessboard, millimeter inscriptions, soft light ???

    1 Reply Last reply
    0

    1/1

    10 Nov 2021, 11:16

    • Login

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