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

Depth of the dome

    XMLWordPrintable

Details

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

    Description

      when depth of a dome is changed, it displays the unusual. Only the default (3) is working fine.

      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.15, 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,4);
          //myDome.setBaseEnabled(false);
          builder << myDome;
          builder.currentNode()->setMaterialIndex(domeMat);
          builder.currentNode()->setEffect(QGL::LitDecalTexture2D);
          dome = builder.currentNode();
      
      
          cone->addNode(dome);
      
          dome->setPosition(QVector3D(0,0.5,1));
          cone->setPosition(QVector3D(0,0,-0.75));
      
          cylinder = builder.finalizedSceneNode();
          cylinder->setParent(this);
      

      Attachments

        1. cylinder.zip
          818 kB
        2. dome_depth.png
          dome_depth.png
          63 kB
        3. dome_depth.rtf
          400 kB
        4. good-cone.png
          good-cone.png
          47 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        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:

              Gerrit Reviews

                There are no open Gerrit changes