Reference / 3D scenes namespace 3D Scenes 1 function UI apps only
datumhue.scene 3D scene graph: meshes, lights, cameras, raycasting.
Returns handles Scene
Functions 1
datumhue.scene. newfunction UI apps only Create a 3D scene viewport.
Example
local scene = datumhue .scene.new ({ width = 320 , height = 240 })
scene:mount ({ width = 320 , height = 240 })
scene:cube ({ color = datumhue .color ("#7fbbb3" ) })opts scene.SceneNewOptions options 3 keys
Key Type Default Description width number 512 Viewport width in pixels. height number 512 Viewport height in pixels. hdr boolean false Enable HDR rendering.
In the guide: Draw shapes and text 3D scenes Shaders
Types 10
scene.BillboardMode enum Value Description "y_locked""full""none"
Used by: SceneNode.billboard
Nested in: scene.SpriteOptions
scene.ClipDirection enum Value Description "forward""reverse""ping_pong"
Nested in: scene.ClipDef
scene.DeformKind enum Value Description "wave"Directional sine across local XZ, displacing local Y. "ripple"Radial sine out from origin in local XZ, displacing local Y. "sway"Lateral bend along direction, weighted by height so the base stays anchored. "noise"Smooth animated noise over local XZ, displacing local Y.
Used by: Deformer.kind
Nested in: scene.DeformOptions
scene.LightOptions options options 3 keys
Key Type Default Description color Color datumhue.color(1, 1, 1)Light color. intensity number 1000 Luminous intensity. shadows boolean false Cast shadows.
Extended by: scene.DirectionalLightOptions , scene.PointLightOptions , scene.SpotLightOptions
scene.MeshOptions options options 5 keys, 3 inherited
Key Type Default Description color Color datumhue.color(1, 1, 1)Base color of the node's own material; ignored when material is given. material Material | Shader a standard material of color Material handle to apply: a standard Material, or a Shader, whose color the mesh shows unlit (a Material's shader lights it). From scene.Transform3dOptions pos Vec3 datumhue.math.vec3(0, 0, 0) World-space position. rotation Quat datumhue.math.quat.identity() Rotation quaternion. Build with datumhue.math.quat.from_euler etc. scale Vec3 datumhue.math.vec3(1, 1, 1) Per-axis scale.
Used by: Scene:cube , Scene:sphere , Scene:cylinder , Scene:capsule , Scene:torus , Scene:cone
scene.PlayOpts options options 2 keys
Key Type Default Description speed number the animator keeps its current speed Playback rate multiplier; negative plays the clip in reverse. looping boolean the clip's own looping Override the clip's loop policy for this play.
Used by: Animator:play , Animator:queue
scene.SpriteAlphaMode enum Value Description "cutout""blend""opaque""hash"
Used by: SceneNode.alpha
Nested in: scene.SpriteOptions
scene.SpriteSizeMode enum Value Description "world""screen"
Used by: SceneNode.size_mode
Nested in: scene.SpriteOptions
scene.Tonemapping enum Value Description "none""reinhard""reinhard_luminance""aces""agx""somewhat_boring""blender_filmic""tony_mcmapface""khronos_pbr_neutral"
Used by: Scene.tonemapping