GeomPolygon
Inherits: Node3D
A regular polygon in 3D space.
Drawing it
The code behind the picture above.
GeomDraw.polygon_angle = 0.3
GeomDraw.regular_polygon_colored(Vector3.ZERO, 1.0, 6, MINT) Properties
| float | angle_degrees | 90.0 |
| bool | billboard | false |
| BlendMode | blend_mode | Geom.BLEND_TRANSPARENT |
| bool | border | false |
| Color | color | Color(1, 1, 1, 1) |
| Color | color_end | Color(1, 1, 1, 1) |
| ColorMode | color_mode | Geom.COLOR_SINGLE |
| GeomDash | dash | null |
| float | radius | 0.5 |
| ThicknessSpace | radius_space | Geom.SPACE_METERS |
| float | roundness | 0.0 |
| int | sides | 6 |
| float | thickness | 0.05 |
| ThicknessSpace | thickness_space | Geom.SPACE_METERS |
Enumerations
enum Geom.ThicknessSpace
- Geom.SPACE_METERS = 0
- Thickness in world units; shrinks on screen with distance.
- Geom.SPACE_PIXELS = 1
- Thickness in screen pixels; constant on-screen size.
- Geom.SPACE_VIEWPORT = 2
- A fraction of the viewport: 100 span its shorter side, so 1 is one percent of it and about 11 pixels at 1080p. The same idea as CSS
vmin. Radii and sizes here are whole-ish numbers; strokes come out below 1, and a stroke that should stay a fixed pixel width wantsSPACE_PIXELSinstead.
enum Geom.ColorMode
- Geom.COLOR_SINGLE = 0
- One flat color.
- Geom.COLOR_RADIAL = 1
- Interpolate
colortocolor_endfrom the center outwards. - Geom.COLOR_ANGULAR = 2
- Interpolate
colortocolor_endaround the sweep.
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
float angle_degrees = 90.0
Rotates the polygon about its own center. The angle points at an edge's midpoint rather than at a vertex, so the vertices sit half a segment either side of it.
bool billboard = false
Turn to face the camera instead of sitting in this node's own plane.
Off by default, so rotating the node rotates the shape. Turn it on for something that must stay readable from any angle, such as a marker on the ground or a bar over a character's head.
BlendMode blend_mode = Geom.BLEND_TRANSPARENT
How the shape combines with what is behind it. Transparent Depth is the one that also writes depth, so shapes occlude each other by position rather than by the order they were drawn.
bool border = false
Outline instead of a fill.
Color color = Color(1, 1, 1, 1)
Fill color, or the wall's color for an outline.
Color color_end = Color(1, 1, 1, 1)
The far end of the gradient. Ignored unless color_mode is something other than Single.
ColorMode color_mode = Geom.COLOR_SINGLE
Single flat color, or a Radial or Angular gradient between color and color_end.
GeomDash dash = null
Assign a GeomDash to dash this shape; leave empty for solid.
float radius = 0.5
Center to vertex.
ThicknessSpace radius_space = Geom.SPACE_METERS
Whether radius is measured in meters, in pixels, or in viewport units. Meters are world units and shrink with distance; pixels hold their size on screen however far away the camera is. The node's scale multiplies it either way.
float roundness = 0.0
Corner rounding, 0 sharp to 1 exactly the inscribed circle.
int sides = 6
Three or more; clamped to 255.
float thickness = 0.05
Wall thickness, used only when border is set.
ThicknessSpace thickness_space = Geom.SPACE_METERS
Whether thickness is measured in meters, in pixels, or in viewport units. Meters are world units and shrink with distance; pixels hold their size on screen however far away the camera is. The node's scale multiplies it either way.