Contents

ModelDebugOptionsComponent.VisualizationMode.bitangent

A mode that displays the surface bitangent vectors as a color.

Declaration

case bitangent

Discussion

Add a ModelDebugOptionsComponent with a visualization mode of bitangent to an entity to tell RealityKit to draw that entity’s calculated surface bitangent vectors as its surface color. A bitangent vector is an imaginary line that’s orthagonal to both the normal and tangent vectors. RealityKit draws a bitangent vector by using its X, Y, and Z values as the R, G, and B components of the color.

RealityKit calculates bitangents for entities with a VideoMaterial, UnlitMaterial, or SimpleMaterial as well as for entities imported from a USDZ file. If an entity doesn’t fall within those parameters, this option has no effect on the rendering.

Here’s how to enable bitangent visualization for an entity:

if let television = try? await ModelEntity(named: "tv_retro") {
    let component = ModelDebugOptionsComponent(visualizationMode: .bitangent)
    television.components.set(component)
}

None

bitangent

[Image]

[Image]

See Also

Visualization modes