shape3d component
A 3D primitive at the node, tinted by color and drawn with texture. kind is sphere, box, capsule, cylinder, cone, plane, torus, pyramid, prism or tube.
На тази страница
3d · render · 26 properties · 3D
A 3D primitive at the node, tinted by color and drawn with texture. kind is sphere, box, capsule, cylinder, cone, plane, torus, pyramid, prism or tube.
In a scene, shape3d is the node key that applies it. A script reaches each property below as a field on node.shape3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.shape3d.get() and node.shape3d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
cast_shadow |
bool | true |
Whether this casts a shadow from the lights that cast |
color |
color | [0.8,0.8,0.8,1] |
Tint, as channel floats or #rrggbb / #rrggbbaa |
corner_radius |
float | 0 |
How far the edges are rounded off, when kind is box; zero is a square edge At least 0. |
depth_test |
bool | true |
Let the scene hide it; off draws it over everything drawn before it and leaves the depth as it was |
dot_color |
color | [0,0,0,0] |
The vertex dots' colour; an alpha of zero takes the node's own. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage |
dot_size |
float | 0 |
Size of a dot drawn on every vertex; zero draws none. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage. Not on WebGL2 At least 0. |
dot_sizing |
enum | world |
What dot_size counts: world is pixels at one world unit from the camera, thinning with distance, screen is pixels One of world, screen. |
draw_surface |
bool | true |
Whether the surface draws; off leaves the wireframe and the dots alone |
height |
float | 2 |
Length along y, tip to tip, for capsule, cylinder, cone, prism and tube At least 0.01. |
inner_radius |
float | 0.25 |
Radius of the hole, when kind is tube At least 0.01. |
kind |
enum | box |
Rendered 3D shape One of sphere, box, capsule, cylinder, cone, plane, torus, pyramid, prism, tube. |
light_layers |
int | -1 |
Light-layer bitmask; a light3d lights this when their masks share a bit. -1 is every layer |
material |
asset · material |
— | The material this draws with; empty draws with the built-in one |
radius |
float | 0.5 |
Radius, for every kind but box, plane and pyramid At least 0.01. |
receive_shadows |
bool | true |
Whether shadows land on it; off lights it as if nothing stood between it and every light |
render_layers |
int | -1 |
Layer bitmask; a camera3d draws this when their render_layers share a bit. -1 is every layer |
rings |
int | 16 |
Cuts along the axis, for ball, capsule and torus At least 3. |
segmentation_id |
int | 0 |
The id render.snap_aov("segmentation") colours this node by; nodes sharing one share a colour. Zero takes one of its own, from 1 up At least 0. |
segments |
int | 32 |
Cuts around the axis, or across a plane At least 3. |
sides |
int | 4 |
Flat faces, when kind is pyramid or prism At least 3. |
size |
vec3 | [1,1,1] |
Whole size along each axis, when kind is box, plane or pyramid |
texture |
asset · texture |
— | Image file, project-relative, or a texture asset, drawn over the shape's own UVs; empty draws the colour alone |
tube_radius |
float | 0.2 |
Thickness of the ring, when kind is torus At least 0.01. |
wireframe_color |
color | [0,0,0,0] |
The wireframe's colour; an alpha of zero takes the node's own. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage |
wireframe_sizing |
enum | world |
What wireframe_width counts: world is pixels at one world unit from the camera, thinning with distance, screen is pixels One of world, screen. |
wireframe_width |
float | 0 |
Width of a line drawn along every triangle edge; zero draws none. Not drawn on a skinned mesh, which Balaur poses in its own vertex stage. Not on WebGL2 At least 0. |
Asset types this component references: material, texture.
Script functions
Methods of node.shape3d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().
From render:
| method | what it does |
|---|---|
set_box(float, float, float) |
Draw the node as a box from its three half-extents, in world units, replacing any other 3D shape. |
set_sphere(float) |
Draw the node as a sphere of the given radius in world units, replacing any other 3D shape. |