geom

GeomSphere

Inherits: Node3D

A solid sphere in 3D space.

Drawing it

The code behind the picture above.

GeomDraw.matrix = Transform3D.IDENTITY
GeomDraw.blend_mode = Geom.BLEND_OPAQUE
GeomDraw.sphere_colored(Vector3.ZERO, 1.0, VIOLET)

Properties

BlendMode blend_mode Geom.BLEND_OPAQUE
Color color Color(1, 1, 1, 1)
int primitive_detail 24
float radius 0.5
float shading 0.75

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. Opaque is the only mode that writes depth, so it is the only one that sorts correctly against other 3D geometry.

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

Fill color for the solid.

int primitive_detail = 24

Segments around the equator. Higher is rounder and costs more vertices.

float radius = 0.5

Radius in meters. The node's scale multiplies it.

float shading = 0.75

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