/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example hellocube
    \ingroup quick3d-examples
    \title Qt Quick 3D - HelloCube Example
    \brief Demonstrates how to render 2D and 3D objects together in Qt Quick 3D.
    \image hellocube.png

    \e {HelloCube} demonstrates how to render a 3D cube with 2D items in
    Qt Quick 3D.

    \section1 Draw 2D Items

    We set up the entire scene in the \e main.qml file.

    To be able to use the types in the QtQuick3D module, we must import it:

    \quotefromfile hellocube/main.qml
    \skipto import QtQuick3D
    \printuntil QtQuick3D 1.14

    We define simple QtQuick Items with an Image and a Text on a Rectangle.
    \snippet hellocube/main.qml 2d

    This simple rectangle has two animations for flipping vertically.
    \snippet hellocube/main.qml 2danimation

    \section1 Draw a 3D Cube

    Drawing a cube is very simple. After defining a \l Camera, and a \l Light,
    we make a cube with a built-in \l Model.
    In this example, we render previous 2D Rectangle on this cube surface as
    a diffuse \l Texture.
    Back to the properties of the Rectangle, you can see layer.enabled.
    This property makes the 2D item as a offscreen surface.
    \snippet hellocube/main.qml offscreenSurface

    Normally the texture is shown upside down due to the difference of coordinates
    between the 2D image and the 3D texture. So, we use the Texture.flipV property
    to flip it.
    \snippet hellocube/main.qml 3dcube
*/
