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. bounds / BoundingVolume from Model with source "#cube"
Forum Updated to NodeBB v4.3 + New Features

bounds / BoundingVolume from Model with source "#cube"

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 182 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.
  • A Offline
    A Offline
    anna77
    wrote on last edited by anna77
    #1

    Hey everybody,

    I need the bounds or the boundingVolume of my Cube-Model in QML.

    Model {
                id: test
                source: "#Cube"
                scale: Qt.vector3d(1.2,1.2,1.2)
                position: Qt.vector3d(1, 1, 1)
                Component.onCompleted: {
                       // I want to get the bounds here
                    }
            }
    

    I've tested a lot. But when I try to get my bounds, they are always undefined or the bounds-Vector is empty.
    It makes no difference if I use "Component.onCompleted" or if I check the bounds outside of my model. They are always undefined.

    Why do I need the bounds?
    I want to put some other Cubes into a big "outerCube" via a Repeater. I have to know where the outerCube-Lines start and end, so that i can make sure, that all innerCubes are inside the outerCube.

    Thank you!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      anna77
      wrote on last edited by
      #2

      Found a solution that works for me. You get the minimum and maximum vector of the model via bounds.minimum and bounds.maximum and can calculate everything else.

      1 Reply Last reply
      0
      • A anna77 has marked this topic as solved on

      • Login

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