geom

GeomCuboidGeom.Nodes.Cuboid

Inherits: Node3D

C#: make one with the Geom.Nodes.Cuboid() factory, then set and read its properties by name with Set and Get, or in the Inspector, where the node is GeomCuboid.

A solid box in 3D space.

From code

The code used to generate this page's thumbnail.

# Turned so three faces are visible.
var box := GeomCuboid.new()
box.rotation = Vector3(0, 0.62, 0)
box.size = Vector3(1.5, 1.5, 1.5)
box.color = EMBER
box.blend_mode = Geom.BLEND_OPAQUE
add_child(box)
// Turned so three faces are visible.
var box = Geom.Nodes.Cuboid();
box.Rotation = new Vector3(0, 0.62f, 0);
box.Set("size", new Vector3(1.5f, 1.5f, 1.5f));
box.Set("color", EMBER);
box.Set("blend_mode", (int)Geom.BlendMode.Opaque);
AddChild(box);

Properties

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

Enumerations

enum Geom.BlendMode

Geom.BLEND_OPAQUEGeom.BlendMode.Opaque = 0
Sorts by position. Hard edges: no anti-aliasing, and alpha is ignored.
Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent = 1
Standard alpha blending. The default.
Geom.BLEND_ADDITIVEGeom.BlendMode.Additive = 2
Adds this color to what is behind.
Geom.BLEND_MULTIPLYGeom.BlendMode.Multiply = 3
Multiplies what is behind by this color.
Geom.BLEND_SUBTRACTGeom.BlendMode.Subtract = 4
Subtracts this color from the background.
Geom.BLEND_TRANSPARENT_DEPTHGeom.BlendMode.TransparentDepth = 5
Transparent, but writes depth, so shapes with alpha 1 sort by position with anti-aliased edges. A translucent color behaves like Transparent.

Property descriptions

BlendMode blend_mode = Geom.BLEND_OPAQUEGeom.BlendMode.Opaque

How the solid blends with what is behind it. Opaque, and Transparent Depth with an opaque color, sort by position; the rest draw in call order.

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

Color.

float shading = 0.75

How strongly the solid is shaded, 0 flat to 1 full.

Vector3 size = Vector3(1, 1, 1)

Width, height and depth in world units.