Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

CarChallenge 3D Demo

 import QtQuick 2.0
 import Felgo 3.0

 // for the PlaneMesh
 import Qt3D.Core 2.0
 import Qt3D.Render 2.0

 // needs not to be an Entity, as it does not get removed & created dynamically and shall not be stored with the Level
 Item {
   id: ground

   // 2D ground of the level
   Image {
       id: playgroundImage
       source: "../../assets/img/playground.jpg"
       anchors.fill: parent
   }

   Render3D {
     // the ground is positioned with 0/0 in the item center
     xOffset: -parent.width/2
     yOffset: -parent.height/2
     zOffset: -0.1 // to avoid z fighting, move it a bit down

     rotationOffset: 270
     rotationAxisOffset: Qt.vector3d(1,0,0)

     texture: "../../assets/3d/grnd.jpg"
     textureScale: 20 // makes it look better, as the texture is repeated across the big ground

     components: [renderTransform, material, planeMesh]
   }

   PlaneMesh {
     id: planeMesh
     width: parent.width
     height: parent.height
   }

   // does not look better - if the camera is outside the wall, it is visible that the outer box does not match the skybox
   // ideally we would move up the skybox so its ground matches z:0, currently it is centered
 //  Render3D {
 //    // the ground is positioned with 0/0 in the item center
 //    xOffset: -parent.width/2
 //    yOffset: -parent.height/2
 //    zOffset: 0.1 // move it below the asphalt texture
 //    scaleOffset: 1.05

 //    rotationOffset: 270
 //    rotationAxisOffset: Qt.vector3d(1,0,0)

 //    texture: "../../assets/3d/cubemaps/mountains/mountains_negy.bmp"
 //    textureScale: 20 // makes it look more crisp, as the texture is repeated across the big ground

 //    components: [renderTransform, material, planeMesh]
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded