3D attributes filtering

The ability to work with 3D attributes is a feature that works with ArcGIS3DModelLayers to allow you to visualize the objects in the layer in a more meaningful way. 3D Object scene layers have attributes with values for each node. Depending on how the layer was authored, the cached attributes can have a slew of different information.

building height

In the image above is an example of what you can do with the 3D attributes functionality. In this image you see the buildings differently based on their "NUM_FLOORS" attribute to show buildings with more than 100 floors in red, buildings with more than 20 floors in yellow and the remaining buildings in green.

empire building

The image above is an example of how to use the "NAME" attribute to visualize the Empire State building in a unique way. Set up an Attribute transform so it can find the feature with the name of "Empire State Building". This gives you the ability to apply a different texture to that specific building. In this example you can also use more complicated textures than just solid colors to bring more realism to the 3D object scene layers that do not have textures baked in.

Relevant API

New methods were added to ArcGIS3DModelLayer to support this feature

Use dark colors for code blocksCopy
   
1
2
3
GetMaterialReference
SetMaterialReference
SetAttributesToVisualize

The MaterialReference property on the ArcGIS3DModelLayer allows you to specify a material to render the layer with. You can use this method without using any layer attributes to render the layer with a different material than the one used by default by the layer.

SetAttributesToVisualize allows you to specify which attributes will be published in a texture to the MaterialReference. By default, no attributes are published to the material, so using the SetAttributesToVisualize allows you to set an array of the attributes you want to publish. This step requires you to have knowledge of the attributes in your layer.

The shaders that power the materials will only work with integers and floats by default. Doubles are also supported, but internally they are converted to floats. This means that you can set attributes on SetAttributesToVisualize that are of type esriFieldTypeInteger, esriFieldTypeSingle & esriFieldTypeDouble. Here is a full list of types.

If you want to use a field with a different type, use the SetAttributesToVisualize method. This method takes an AttributeTransform. It allows you to convert an attribute such as "NAME" into a float or integer that has meaning within the material's shader.

Learn how to use

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.