Skip to content
Snippets Groups Projects
Commit ab3665de authored by Andy Nichols's avatar Andy Nichols
Browse files

Update readme to use renamed API

parent 243965b1
No related branches found
No related tags found
No related merge requests found
Pipeline #3802 failed
...@@ -8,7 +8,7 @@ Qt Quick 3D is a high level 3D API for Qt Quick. Unlike Qt3D, Qt Quick 3D enabl ...@@ -8,7 +8,7 @@ Qt Quick 3D is a high level 3D API for Qt Quick. Unlike Qt3D, Qt Quick 3D enabl
``` ```
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import QtDemon 1.0 import QtQuick3D 1.0
Window { Window {
id: window id: window
...@@ -17,21 +17,21 @@ Window { ...@@ -17,21 +17,21 @@ Window {
height: 720 height: 720
// Viewport for 3D content // Viewport for 3D content
DemonView3D { View3D {
id: view id: view
anchors.fill: parent anchors.fill: parent
// Scene to view // Scene to view
DemonNode { Node {
id: scene id: scene
// To render anything to a 3D viewport, you need 3 things // To render anything to a 3D viewport, you need 3 things
// Light, Camera, Model // Light, Camera, Model
DemonLight { Light {
id: directionalLight id: directionalLight
} }
DemonCamera { Camera {
id: camera id: camera
// It's important that your camera is not inside your model // It's important that your camera is not inside your model
// So move it back a big along the z axis // So move it back a big along the z axis
...@@ -40,7 +40,7 @@ Window { ...@@ -40,7 +40,7 @@ Window {
z: -600 z: -600
} }
DemonModel { Model {
id: cubeModel id: cubeModel
// #Cube is one of the "built-in" primitive meshes // #Cube is one of the "built-in" primitive meshes
// Other Options are #Cone, #Sphere, #Cylinder, #Rectangle // Other Options are #Cone, #Sphere, #Cylinder, #Rectangle
...@@ -53,7 +53,7 @@ Window { ...@@ -53,7 +53,7 @@ Window {
// All of the default primitive meshes contain one sub-mesh, so you only // All of the default primitive meshes contain one sub-mesh, so you only
// need 1 material. // need 1 material.
materials: [ materials: [
DemonDefaultMaterial { DefaultMaterial {
// We are using the DefaultMaterial which dynamically generates a shader // We are using the DefaultMaterial which dynamically generates a shader
// based on what properties are set. This means you don't need to write // based on what properties are set. This means you don't need to write
// any shader code yourself. In this case we just want the cube to have // any shader code yourself. In this case we just want the cube to have
...@@ -66,4 +66,4 @@ Window { ...@@ -66,4 +66,4 @@ Window {
} }
} }
} }
``` ```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment