Concepts Geometries and Visuals
This concepts page combines geometry and visual setup:
- defining geometry directly on a
Physics3D.System - giving each geometry a
local_transform - creating matching visuals and understanding the difference
Geometry and visual side by side
Geometry and visuals can both be added to a Physics3D.System.
In this concepts page:
geometryis the simulation shape (used for physical interaction)visualis the rendered shape (used for what you see)
SimpleScene is Physics3D.System:
pillar_geometry is Physics3D.Geometries.Cylinder:
local_transform.position: Math.Vec3.from_xyz(0.0, 0.0, 0.5)
radius: 0.15
height: 1.0
pillar_visual is Visuals.Geometries.Cylinder:
local_transform.position: Math.Vec3.from_xyz(0.0, 0.0, 0.5)
radius: 0.15
height: 1.0
The two objects are complementary:
- change
pillar_geometryto affect simulation behavior - change
pillar_visualto affect rendering appearance
Organizing geometry and visual variants for reuse
Define base system models and specialize dimensions and transforms in child models.
BaseMarkerScene is Physics3D.System:
marker_geometry is Physics3D.Geometries.Cylinder:
local_transform.position: Math.Vec3.from_xyz(0.0, 0.0, 1.0)
radius: 0.2
height: 0.3
marker_visual is Visuals.Geometries.Cylinder:
local_transform.position: marker_geometry.local_transform.position
radius: marker_geometry.radius
height: marker_geometry.height
SmallMarkerScene is BaseMarkerScene:
marker_geometry.radius: 0.1
marker_geometry.height: 0.2
LargeMarkerScene is BaseMarkerScene:
marker_geometry.radius: 0.4
marker_geometry.height: 0.8
Here marker_visual reads its dimensions and position from marker_geometry, so variants only update one source of truth.
Preparing for later interaction logic
Even before introducing rigid bodies, you can structure the scene so geometry/visual pairs are easy to reference later.
AssemblyLayout is Physics3D.System:
axle_geometry is Physics3D.Geometries.Cylinder:
local_transform:
position: Math.Vec3.from_xyz(0.0, 0.0, 0.2)
rotation: Math.Quat.from_euler_angles(0.0, Math.Functions.deg_to_rad(90.0), 0.0)
radius: 0.05
height: 1.0
axle_visual is Visuals.Geometries.Cylinder:
local_transform.position: axle_geometry.local_transform.position
local_transform.rotation: axle_geometry.local_transform.rotation
radius: axle_geometry.radius
height: axle_geometry.height
Recommended naming pattern:
<name>_geometryfor simulation shape<name>_visualfor rendered counterpart
That makes later concepts pages on rigid bodies, mates, and signals easier to follow.