view3dKind top-level property
A 3D view: an orbit camera around a target, drawing its model children.
Implementation
final SceneKind view3dKind = SceneKind(
_view3dName,
constructor: 'View3DNode',
children: true,
help:
'With the Orbit tool (O), drag the window to turn the camera and '
'scroll to bring it closer. Add a model or a screen from the tree.',
props: [
SceneProp.value(
'yaw',
ScenePropKind.number,
of: _view3dName,
defaultValue: 0.0,
animatable: true,
unit: '°',
angular: true,
softMin: -180,
softMax: 180,
),
SceneProp.value(
'pitch',
ScenePropKind.number,
of: _view3dName,
defaultValue: 10.0,
animatable: true,
unit: '°',
angular: true,
softMin: -89,
softMax: 89,
),
SceneProp.value(
'distance',
ScenePropKind.number,
of: _view3dName,
defaultValue: 5.0,
animatable: true,
softMin: 0.1,
softMax: 500,
),
SceneProp.value(
'fov',
ScenePropKind.number,
of: _view3dName,
defaultValue: 45.0,
animatable: true,
unit: '°',
softMin: 10,
softMax: 120,
),
SceneProp.value(
'targetX',
ScenePropKind.number,
of: _view3dName,
defaultValue: 0.0,
animatable: true,
),
SceneProp.value(
'targetY',
ScenePropKind.number,
of: _view3dName,
defaultValue: 0.0,
animatable: true,
),
SceneProp.value(
'targetZ',
ScenePropKind.number,
of: _view3dName,
defaultValue: 0.0,
animatable: true,
),
SceneProp.value(
'exposure',
ScenePropKind.number,
of: _view3dName,
defaultValue: 1.0,
animatable: true,
softMin: 0,
softMax: 4,
),
// The light. `ambient` scales the engine's own studio environment,
// which is what lights a model with nothing else said; `light` adds a
// sun — a directional light aimed by yaw and pitch, pitch up from the
// horizon — and is off at zero.
SceneProp.value(
'ambient',
ScenePropKind.number,
of: _view3dName,
defaultValue: 1.0,
animatable: true,
softMin: 0,
softMax: 4,
),
SceneProp.value(
'light',
ScenePropKind.number,
of: _view3dName,
defaultValue: 0.0,
animatable: true,
softMin: 0,
softMax: 10,
),
SceneProp.value(
'lightYaw',
ScenePropKind.number,
of: _view3dName,
defaultValue: -45.0,
animatable: true,
unit: '°',
angular: true,
softMin: -180,
softMax: 180,
),
SceneProp.value(
'lightPitch',
ScenePropKind.number,
of: _view3dName,
defaultValue: 50.0,
animatable: true,
unit: '°',
angular: true,
softMin: -89,
softMax: 89,
),
SceneProp.value(
'lightColor',
ScenePropKind.color,
of: _view3dName,
defaultValue: const SceneColor(0xFFFFFFFF),
animatable: true,
),
],
);