Hi.
Sorry, but I'm bad speak English=)
I use Qt5 and Qt3D module. I created qglsphere object as in example "solarsystem":
QGLBuilder builder;
QGLSceneNode *root = builder.sceneNode();
...
//planetary surface
QGLMaterial *mat2 = new QGLMaterial;
mat2->setTextureUrl(url);
m_LoadedTextures.push_back(mat2->texture());
int planetMat = root->palette()->addMaterial(mat2);
...
// create the planet
builder<<QGLSphere(0.4);
builder.currentNode()->setMaterialIndex(planetMat);
builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
...
return builder.finalizedSceneNode();
QGLBuilder builder;
QGLSceneNode *root = builder.sceneNode();
QUrl url;
...
//planetary surface
QGLMaterial *mat2 = new QGLMaterial;
url.setPath(QLatin1String(":/planet.jpg"));
url.setScheme(QLatin1String("file"));
mat2->setTextureUrl(url);
m_LoadedTextures.push_back(mat2->texture());
int planetMat = root->palette()->addMaterial(mat2);
...
// create the planet
builder.newNode()->setObjectName(QLatin1String("Planet"));
builder<<QGLSphere(0.4);
builder.currentNode()->setMaterialIndex(planetMat);
builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
...
return builder.finalizedSceneNode();
To copy to clipboard, switch view to plain text mode
but I can not overlay texture on the part this sphere with any coordinates.
For example, like this
part3_sphere1.jpg
I want get random coordinates and overlay there random square texture (not to the whole sphere).
Сan anyone show an example how to do it?
thanks in advance=)
Bookmarks