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

disabling the base of QGLDome and setPosition

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt3D TP2
    • Qt3D TP1
    • Qt3D
    • None
    • 2e5f768c19ae6cd259555bfdce0b1b9f1a4af268

    Description

      when the base of the dome is disabled, then setPosition is behaving strangly

          QGLBuilder builder;
          QGLSceneNode *root = builder.sceneNode();
      
          QGLMaterial *coneMaterial = new QGLMaterial;
          coneMaterial->setAmbientColor(Qt::gray);
          coneMaterial->setDiffuseColor(Qt::gray);
          QUrl urlLid;
          urlLid.setPath(QLatin1String(":/only_cone1_mod.jpg"));
          urlLid.setScheme(QLatin1String("file"));
          coneMaterial->setTextureUrl(urlLid);
          int coneMat = root->palette()->addMaterial(coneMaterial);
      
          builder.newNode()->setObjectName(QLatin1String("cone"));
          QGLCylinder myCylinder (0.75, 0.25, 0.75, 36, 25, true, true);
          myCylinder.setBaseEnabled(false);
          myCylinder.setTopEnabled(false);
          builder << myCylinder;
          builder.currentNode()->setMaterialIndex(coneMat);
          builder.currentNode()->setEffect(QGL::LitDecalTexture2D);
          cone = builder.currentNode();
          root->addNode(cone);
      
          QGLMaterial *domeMaterial = new QGLMaterial;
          QUrl url;
          url.setPath(QLatin1String(":/icecream1_mod.jpg"));
          url.setScheme(QLatin1String("file"));
          domeMaterial->setTextureUrl(url);
          int domeMat = root->palette()->addMaterial(domeMaterial);
      
          builder.newNode()->setObjectName(QLatin1String("dome"));
          QGLDome myDome(0.75);    
          myDome.setBaseEnabled(false);
          builder << myDome;
          builder.currentNode()->setMaterialIndex(domeMat);
          builder.currentNode()->setEffect(QGL::LitDecalTexture2D);
          dome = builder.currentNode();
      
      
          cone->addNode(dome);
          cone->setPosition(QVector3D(1.0f,1.0,0));
          dome->setPosition(QVector3D(2.0f,2.0,0));
      
          cylinder = builder.finalizedSceneNode();
          cylinder->setParent(this);
      

      -----------
      output:

      Attachments

        1. bad-with-base-enabled.png
          75 kB
          Sarah Smith (closed Nokia identity)
        2. cap_dome_bug.rtf
          433 kB
          nandita anilkant mehta
        3. good-cone.png
          47 kB
          Sarah Smith (closed Nokia identity)
        4. icecream.png
          64 kB
          Sarah Smith (closed Nokia identity)

        Activity

          People

            sarasmit Sarah Smith (closed Nokia identity) (Inactive)
            nandmeht nandita anilkant mehta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: