Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OBB (Oriented Bounding Box)
Forum Updated to NodeBB v4.3 + New Features

OBB (Oriented Bounding Box)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.8k Views 2 Watching
  • 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.
  • P Offline
    P Offline
    Pswin
    wrote on 15 Apr 2017, 10:22 last edited by
    #1

    is there any class in Qt for OBB?

    I have checked QRectf but it seems that it is AABB (Axis aligned bounding box). Infact, I couldn't find any method in it for rotating it or setting angle in it.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Apr 2017, 17:18 last edited by
      #2

      Hi,

      Are you looking for QTransform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Pswin
        wrote on 16 Apr 2017, 06:23 last edited by
        #3

        I suppose it only transforms(rotates) the QRectf. What I really need is QRectf::intersect method. I seems to me it only works when two QRectf are aligned to the axies.

        I have tested QGraphicsItem::collidesWithItem. it works finely with rotted objects. yet it is a graphic item, not a class for testing collision.

        K 1 Reply Last reply 16 Apr 2017, 10:34
        0
        • P Pswin
          16 Apr 2017, 06:23

          I suppose it only transforms(rotates) the QRectf. What I really need is QRectf::intersect method. I seems to me it only works when two QRectf are aligned to the axies.

          I have tested QGraphicsItem::collidesWithItem. it works finely with rotted objects. yet it is a graphic item, not a class for testing collision.

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 16 Apr 2017, 10:34 last edited by
          #4

          QRect and QRectF are normal rectangles, they can't be rotated as such. QTransform can be used with them, but will give you again a normal rectangle (i.e. the bounding box of the operation). You can however apply the transformation to points (QPoint), lines (QLine), polygons (QPolygon) and paths (QPainterPath). You can get the intersection of polygons though (QPolygon::intersected).

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          2

          1/4

          15 Apr 2017, 10:22

          • Login

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