Skip to contents

Base class for all 3D vector mobjects. Extends VMobject with:

  • Shade/lighting metadata (ambient, diffuse, specular)

  • Normal vectors for lighting calculations

  • Depth sorting hints for the renderer

Super classes

manimR::MObject -> manimR::VMobject -> ThreeDVMobject

Public fields

shade

Whether to apply lighting

gloss

Specular shininess (0-1)

shadow

Shadow intensity (0-1)

ambient

Ambient light factor (0-1)

normal

Normal vector for flat surfaces

Methods

Inherited methods


Method new()

Create a ThreeDVMobject

Usage

ThreeDVMobject$new(shade = TRUE, gloss = 0.2, shadow = 0.4, ...)

Arguments

shade

Apply shading

gloss

Specular gloss

shadow

Shadow intensity

...

Passed to VMobject


Method apply_shading()

Apply shading to a color based on normal and light direction

Usage

ThreeDVMobject$apply_shading(base_color, light_dir = c(1, 1, 2))

Arguments

base_color

Hex color

light_dir

Light direction vector (x,y,z)

Returns

Shaded hex color


Method get_depth()

Get depth (average z) for depth sorting

Usage

ThreeDVMobject$get_depth()


Method clone()

The objects of this class are cloneable with this method.

Usage

ThreeDVMobject$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.