Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > c936229ef0138f42857f36beadbeda30 > files > 915

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" />
<!-- qt3drender-geometry.qdoc -->
  <title>Qt 3D Render Geometry | 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 Render Geometry</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="level2"><a href="#buffer">Buffer</a></li>
<li class="level2"><a href="#attribute">Attribute</a></li>
<li class="level2"><a href="#geometry">Geometry</a></li>
<li class="level2"><a href="#geometryrenderer">GeometryRenderer</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt 3D Render Geometry</h1>
<span class="subtitle"></span>
<!-- $$$qt3drender-geometry.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt 3D Render provides a generic way of storing geometry data and specifying how it should be read by the renderer.</p>
<ul>
<li><a href="qt3drender-geometry.html#buffer">Buffer</a></li>
<li><a href="qt3drender-geometry.html#attribute">Attribute</a></li>
<li><a href="qt3drender-geometry.html#geometry">Geometry</a></li>
<li><a href="qt3drender-geometry.html#geometryrenderer">GeometryRenderer</a></li>
</ul>
<a name="buffer"></a>
<h3 >Buffer</h3>
<p>The <a href="qt3drender-qbuffer.html">Qt3DRender::QBuffer</a> class stores the raw data. This acts purely as an array of memory. In most cases a <a href="qt3drender-qbuffer.html">Qt3DRender::QBuffer</a> will be used indirectly by being referenced by one or more Qt3DRender::QAttributes. However there are times when a QBuffer may be used directly as the value property of a QParameter when dealing with Uniform Buffer Objects (UBO) or Shader Storage Buffer Objects (SSBO).</p>
<pre class="cpp">

  Buffer {
      id: vertexBuffer
      type: Buffer<span class="operator">.</span>VertexBuffer
      data: buildVertexBufferData()
  }

</pre>
<a name="attribute"></a>
<h3 >Attribute</h3>
<p><a href="qt3drender-qattribute.html">Qt3DRender::QAttribute</a> specifies how data contained in the referenced buffer should be extracted and passed to an input of a vertex shader. It references a <a href="qt3drender-qbuffer.html">Qt3DRender::QBuffer</a> and can specify the layout of the attributes by definining the vertex size, the data type, the stride between two vertices and a starting offset. The type of the attribute will also define whether it is to be used as a vertex buffer or as an index buffer. This allows you complete flexibility of how you structure your data in buffers. It is possible to use separate buffers for each vertex attribute, an interleaved buffer containing data for all attributes or a combination of separate and interleaved buffers.</p>
<pre class="cpp">

  Attribute {
      attributeType: Attribute<span class="operator">.</span>VertexAttribute
      vertexBaseType: Attribute<span class="operator">.</span>Float
      vertexSize: <span class="number">3</span>
      byteOffset: <span class="number">0</span>
      byteStride: <span class="number">9</span> <span class="operator">*</span> <span class="number">4</span>
      count: <span class="number">4</span>
      name: defaultPositionAttributeName()
      buffer: vertexBuffer
  }

</pre>
<a name="geometry"></a>
<h3 >Geometry</h3>
<p>A <a href="qt3drender-qgeometry.html">Qt3DRender::QGeometry</a> aggregates various attributes to form a piece of geometry. Usually a proper geometry will provide an attribute for vertex positions, an attribute for vertex normals and an attribute for texture coordinates. If you want your geometry to also work with normal mapped materials it will need to provide a consistent set of vertex tangent vectors too.</p>
<pre class="cpp">

  Geometry {
      Attribute {
          attributeType: Attribute<span class="operator">.</span>VertexAttribute
          vertexBaseType: Attribute<span class="operator">.</span>Float
          vertexSize: <span class="number">3</span>
          byteOffset: <span class="number">0</span>
          byteStride: <span class="number">9</span> <span class="operator">*</span> <span class="number">4</span>
          count: <span class="number">4</span>
          name: defaultPositionAttributeName()
          buffer: vertexBuffer
      }

      Attribute {
          attributeType: Attribute<span class="operator">.</span>VertexAttribute
          vertexBaseType: Attribute<span class="operator">.</span>Float
          vertexSize: <span class="number">3</span>
          byteOffset: <span class="number">3</span> <span class="operator">*</span> <span class="number">4</span>
          byteStride: <span class="number">9</span> <span class="operator">*</span> <span class="number">4</span>
          count: <span class="number">4</span>
          name: defaultNormalAttributeName()
          buffer: vertexBuffer
  }

</pre>
<a name="geometryrenderer"></a>
<h3 >GeometryRenderer</h3>
<p><a href="qt3drender-qgeometryrenderer.html">Qt3DRender::QGeometryRenderer</a> is a QComponent which when aggregated by a QEntity allows to draw the <a href="qt3drender-qgeometry.html">Qt3DRender::QGeometry</a> it references. It provides properties to control the draw call such as the number of instances to be drawn, the starting instance, the type of <a href="qt3drender-qgeometryrenderer.html#PrimitiveType-enum">Qt3DRender::QGeometryRenderer::PrimitiveType</a> to be used, etc. A <a href="qt3drender-qgeometryrenderer.html">Qt3DRender::QGeometryRenderer</a> is translated into a draw call to the underlying graphics API.</p>
<pre class="cpp">

  GeometryRenderer {
      instanceCount: <span class="number">1</span>
      indexOffset: <span class="number">0</span>
      firstInstance: <span class="number">0</span>
      primitiveType: GeometryRenderer<span class="operator">.</span>Triangles
      geometry: Geometry { <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> }
  }

</pre>
</div>
<!-- @@@qt3drender-geometry.html -->
        </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>