2

Does ArcGIS support materials and shaders when importing a model from 3D Max? Can I change the texture of the model when it is already added to the scene? How to do it?

Esri::ArcGISRuntime::SceneQuickView* m_sceneView = nullptr;
Esri::ArcGISRuntime::AnalysisOverlay* m_analysisOverlay = nullptr;
Esri::ArcGISRuntime::GeoElementViewshed* m_viewshed = nullptr;
Esri::ArcGISRuntime::GraphicsOverlay* m_graphicsOverlay = nullptr;
Esri::ArcGISRuntime::Graphic* m_tank = nullptr;

My addition of a 3D model to the scene:

void ViewshedGeoElement::createGraphic()
{
    // Create the Graphic Point
    const double x = -4.508708007847015;
    const double y = 48.38823243446344;
    const double z = 0;
    const Point tankPoint(x, y, z, SpatialReference(4326));
    const QString dataPath = QQmlProperty::read(this, "dataPath").toString();
    const float scale = 1;

    // Create the Graphic Symbol
    ModelSceneSymbol* sceneSymbol = new ModelSceneSymbol(QUrl(dataPath + "/2C19Msta-C/2c19Msta.3DS"), scale, this);
    sceneSymbol->setAnchorPosition(SceneSymbolAnchorPosition::Bottom);
    sceneSymbol->setHeading(180.0f);

    // Create the Graphic
    QVariantMap attr;
    attr[m_headingAttr] = 150.0;
    m_tank = new Graphic(tankPoint, attr, sceneSymbol, this);
    m_graphicsOverlay->graphics()->append(m_tank);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.