Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to create cube with 6 different textures using qml?
Forum Updated to NodeBB v4.3 + New Features

How to create cube with 6 different textures using qml?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 151 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qwe3
    wrote on last edited by
    #1

    Hi,

    There is an application HelloCube in examples:

    [link text]https://doc.qt.io/qt-5/qtquick3d-hellocube-example.html(link url)

    I see here only one texture: qt_logo, so I would like to have six different textures ( one for each face ). I tried something like:

    materials: [
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e
                                source: "file:///pathToImage/1.jpg"
                            }
                        },
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e5
                                source: "file:///pathToImage/2.jpg"
                            }
                        },
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e4
                                source: "file:///pathToImage/3.jpg"
                            }
                        },
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e3
                                source: "file:///pathToImage/4.jpg"
                            }
                        },
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e2
                                source: "file:///pathToImage/5.jpg"
                            }
                        },
                        DefaultMaterial
                        {
                            diffuseMap: Texture
                            {
                                id: textur2e1
                                source: "file:///pathToImage/6.jpg"
                            }
                        }
                ]
    

    I see only the first source: "file:///pathToImage/1.jpg" texture.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved