geom

GeomCuboid

Inherits: Node3D

A solid box in 3D space.

Drawing it

The code behind the picture above.

# Turned off-axis so three faces are visible. Square-on, a cube shows
# only two, and two faces cannot read as a solid no matter how they
# are lit -- the third is what fixes the shape in space.
GeomDraw.matrix = Transform3D(Basis(Vector3.UP, 0.62), Vector3.ZERO)
GeomDraw.blend_mode = Geom.BLEND_OPAQUE
GeomDraw.cuboid_colored(Vector3.ZERO, Vector3(1.5, 1.5, 1.5), CYAN)

Properties

BlendMode blend_mode Geom.BLEND_OPAQUE
Color color Color(1, 1, 1, 1)
float shading 0.75
Vector3 size Vector3(1, 1, 1)

Enumerations

enum Geom.BlendMode

Geom.BLEND_OPAQUE = 0
Writes depth and sorts against other geometry; hard edges, no fade.
Geom.BLEND_TRANSPARENT = 1
Standard alpha compositing. The default.
Geom.BLEND_ADDITIVE = 2
Brightens what is behind. Good for glows.
Geom.BLEND_MULTIPLY = 3
Darkens what is behind. Good for tints.
Geom.BLEND_SUBTRACT = 4
Subtracts this color from the background.
Geom.BLEND_TRANSPARENT_DEPTH = 5
Transparent, but writing depth so shapes occlude by position.

Property descriptions

BlendMode blend_mode = Geom.BLEND_OPAQUE

How following shapes combine with what is already drawn.

Color color = Color(1, 1, 1, 1)

Fill color for the solid.

float shading = 0.75

How strongly the built-in key light shades the solid, 0 flat to 1 full.

Vector3 size = Vector3(1, 1, 1)

Width, height and depth in meters. The node's scale multiplies them.