Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > c936229ef0138f42857f36beadbeda30 > files > 544

qt3d5-doc-5.12.2-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- scene3d.qdoc -->
  <title>Qt 3D: Scene3D QML Example | Qt 3D 5.12.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qt3d-index.html">Qt 3D</a></td><td >Qt 3D: Scene3D QML Example</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qt3d-index.html">Qt 5.12.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#running-the-example">Running the Example</a></li>
<li class="level1"><a href="#visualizing-3d-scenes">Visualizing 3D Scenes</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt 3D: Scene3D QML Example</h1>
<span class="subtitle"></span>
<!-- $$$scene3d-brief -->
<p>A QML application that demonstrates visualizing a 3D scene.</p>
<!-- @@@scene3d -->
<!-- $$$scene3d-description -->
<div class="descr"> <a name="details"></a>
<p class="centerAlign"><img src="images/scene3d.png" alt="" /></p><p>This example demonstrates visualizing a 3D scene from a Qt Quick application. The 3D scene contains a single active camera and a single active light source. Visualized data is assumed to be at a fixed location.</p>
<a name="running-the-example"></a>
<h2 id="running-the-example">Running the Example</h2>
<p>To run the example from Qt Creator, open the <b>Welcome</b> mode and select the example from <b>Examples</b>. For more information, visit Building and Running an Example.</p>
<a name="visualizing-3d-scenes"></a>
<h2 id="visualizing-3d-scenes">Visualizing 3D Scenes</h2>
<p>We set up the 3D scene and specify the entity to animate in <i>main.qml</i>:</p>
<pre class="cpp">

          Scene3D {
              id: scene3d
              anchors.fill: parent
              anchors.margins: 10
              focus: true
              aspects: ["input", "logic"]
              cameraAspectRatioMode: Scene3D.AutomaticAspectRatio

              AnimatedEntity {}
          }

</pre>
<p>We specify the active camera in <i>scene3d/AnimatedEntity.qml</i>:</p>
<pre class="cpp">

      Camera {
          id: camera
          projectionType: CameraLens.PerspectiveProjection
          fieldOfView: 45
          nearPlane : 0.1
          farPlane : 1000.0
          position: Qt.vector3d( 0.0, 0.0, 40.0 )
          upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
          viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
      }

</pre>
<p>Files:</p>
<ul>
<li><a href="qt3d-scene3d-animatedentity-qml.html">scene3d/AnimatedEntity.qml</a></li>
<li><a href="qt3d-scene3d-main-cpp.html">scene3d/main.cpp</a></li>
<li><a href="qt3d-scene3d-main-qml.html">scene3d/main.qml</a></li>
<li><a href="qt3d-scene3d-scene3d-pro.html">scene3d/scene3d.pro</a></li>
<li><a href="qt3d-scene3d-scene3d-qrc.html">scene3d/scene3d.qrc</a></li>
</ul>
</div>
<!-- @@@scene3d -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>