Details
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: