geom

GeomSphereGeom.Nodes.Sphere

Inherits: Node3D

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

A solid sphere in 3D space.

From code

The code used to generate this page's thumbnail.

var sphere := GeomSphere.new()
sphere.radius = 1.0
sphere.color = PINK
sphere.blend_mode = Geom.BLEND_OPAQUE
add_child(sphere)
var sphere = Geom.Nodes.Sphere();
sphere.Set("radius", 1.0f);
sphere.Set("color", PINK);
sphere.Set("blend_mode", (int)Geom.BlendMode.Opaque);
AddChild(sphere);

Properties

BlendMode blend_mode Geom.BLEND_OPAQUEGeom.BlendMode.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_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.

int primitive_detail = 24

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

float radius = 0.5

Radius in world units.

float shading = 0.75

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