summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/basicshapes-cpp/doc
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@theqtcompany.com>2015-06-16 10:54:29 +0300
committerMika Salmela <mika.salmela@theqtcompany.com>2015-06-18 10:29:13 +0000
commit5d2cbfa6535e2594fe6f9cc71d08085973b2d908 (patch)
tree659a4737aa0f9b364f7eb8a9a57c6ab316310ea2 /examples/qt3d/basicshapes-cpp/doc
parent60cb61f9d70ec52f3193bac44384099d921827b3 (diff)
Documentation for basic shapes example
Add the documentation for the basic shapes example. Change-Id: I9a69198ddbd188ddaa7bd4ab0fae0dc2315719a9 Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/basicshapes-cpp/doc')
-rw-r--r--examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpgbin0 -> 65014 bytes
-rw-r--r--examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc37
2 files changed, 37 insertions, 0 deletions
diff --git a/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg b/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg
new file mode 100644
index 000000000..cdf694427
--- /dev/null
+++ b/examples/qt3d/basicshapes-cpp/doc/images/basicshapes-cpp-example.jpg
Binary files differ
diff --git a/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc
index f408bc43b..004b06817 100644
--- a/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc
+++ b/examples/qt3d/basicshapes-cpp/doc/src/basicshapes.qdoc
@@ -29,4 +29,41 @@
\example basicshapes-cpp
\title Qt3D: Basic Shapes C++ Example
\ingroup qt3d-examples-cpp
+ \brief Shows four basic shapes that Qt3D offers.
+
+ The Basic Shapes examples shows four basic shapes that Qt3D offers, a torus,
+ a cylinder, a cube and a sphere. The example also shows how to embed a Qt3D scene
+ into a widget and connect with other widgets.
+
+ \image basicshapes-cpp-example.jpg
+
+ As an example let's go through how to set up a torus mesh. First instantiate
+ the \c QTorusMesh, and then set the mesh specific parameters, that for torus are
+ radius, minor radius and how many rings and slices.
+
+ \snippet basicshapes-cpp/scenemodifier.cpp 0
+
+ The size and position of the torus can be adjusted with transform components.
+ We create scale, translation and rotation components and add them into the
+ \c QTransform component.
+
+ \snippet basicshapes-cpp/scenemodifier.cpp 1
+
+ To change the diffuse color of the mesh we create a \c QPhongMaterial and set
+ its diffuse color.
+
+ \snippet basicshapes-cpp/scenemodifier.cpp 2
+
+ The final step is to add the torus into an entity tree, and we do that by creating
+ a \c QEntity with parent entity and adding the previously created mesh, material
+ and transform components into it.
+
+ \snippet basicshapes-cpp/scenemodifier.cpp 3
+
+ You can control the visibility of the entity by defining if it has parent
+ or not, i.e. whether it is part of entity tree or not.
+
+ \snippet basicshapes-cpp/scenemodifier.cpp 4
+
+
*/