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

Texture mix up for cylinder and dome

    XMLWordPrintable

Details

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

    Description

      The texture is mixed up for both as in the attached code

       QGLBuilder builder2;
          builder2 << QGLCylinder(0.75, 0.25, 0.75, 36, 25, true, true);
          cone = builder2.currentNode();
          cone->setObjectName(QLatin1String("Cone"));
      
          QGLMaterial *coneMaterial = new QGLMaterial;
          coneMaterial->setAmbientColor(Qt::gray);
          coneMaterial->setDiffuseColor(Qt::gray);
          QUrl coneUrl;
          coneUrl.setPath(QLatin1String(":/dome_icecream4_mod.jpg"));
          coneUrl.setScheme(QLatin1String("file"));
          coneMaterial->setTextureUrl(coneUrl);
          cone->setMaterial(coneMaterial);
          cone->setEffect(QGL::LitDecalTexture2D);
      
      
      
          QGLBuilder builder1;
          builder1 << QGLDome(0.75);
          dome = builder1.currentNode();
          dome->setObjectName(QLatin1String("Dome"));
      
          QGLMaterial *domeMaterial = new QGLMaterial;
          QUrl domeUrl;
          domeUrl.setPath(QLatin1String(":/only_cone1_mod.jpg"));
          domeUrl.setScheme(QLatin1String("file"));
          domeMaterial->setTextureUrl(domeUrl);
          dome->setMaterial(domeMaterial);
          dome->setEffect(QGL::LitDecalTexture2D);
      
          cone->addNode(dome);
          const QVector3D pos (0.7,1,0);
          cone->setPosition(pos);
      
      
          scene2 = builder2.finalizedSceneNode();
          scene2->setParent(this);
      
          scene1 = builder1.finalizedSceneNode();
          scene1->setParent(this);
      

      Attachments

        1. cylinder.zip
          816 kB
        2. texture_mix_up.rtf
          2 kB

        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: