Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10408

QGLPainter.isCullable calculates return value wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Some future release
    • Some future release
    • Qt3D
    • None
    • c589443f467bc4e047d3810e7c794e8c8d072cef

    Description

      To Reproduce:
      line "qDebug() << "Cullable?" << painter->isCullable(QVector3D(0.0f,0.0f,0.0f));" in the following examples->cubeview.cpp
      returns true, instead of false which is correct return value.

      ============
      #include "cubeview.h"
      #include "qglcube.h"

      void CubeView::initializeGL(QGLPainter *painter)
      {
      cube.newSection(QGL::Faceted);
      cube << QGLCube(1.5f);
      painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0));
      QImage textureImage(":/qtlogo.png");
      texture.setImage(textureImage);
      painter->setStandardEffect(QGL::LitDecalTexture2D);
      painter->setTexture(&texture);
      }

      void CubeView::paintGL(QGLPainter *painter)
      {
      qDebug() << "Cullable?" << painter->isCullable(QVector3D(0.0f,0.0f,0.0f));
      painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
      cube.draw(painter);
      }
      =====================
      Fix:
      In QGLPainter:
      QGLPainter line 994: projected = d->projectionMatrix * point;

      should be
      projected = d->projectionMatrix * projected;

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            csnellman Carl Snellman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes