Appearance
@shbernal/ts-pptx / index / Model3dCameraProps
Interface: Model3dCameraProps
Defined in: src/types/model3d.ts:45
Camera override for addModel3d(), mapping onto am3d:camera.
The defaults are what PowerPoint itself wrote for a 2×2×2 cube, and they are correct for any model whose bounding box is roughly cubic once meterPerModelUnit is right — the camera is expressed in metres, so the scale is what actually decides framing.
PowerPoint's own rule, measured against three models: it normalizes the model's largest bounding-box extent to 1 metre and then places the camera at
pos.z = |halfExtents / maxExtent| / sin(fov / 2)looking at the origin. A caller who knows their model's bounding box can reproduce that exactly; a caller who does not should at least set meterPerModelUnit to 1 / maxExtent.
Properties
fov?
optionalfov?:number
Defined in: src/types/model3d.ts:66
Vertical field of view in degrees (am3d:perspective@fov).
- range: greater than 0 and less than 180
Default
ts
45lookAt?
optionallookAt?:Model3dPoint
Defined in: src/types/model3d.ts:55
Point the camera aims at, in metres (am3d:camera/am3d:lookAt).
Default
ts
{ x: 0, y: 0, z: 0 }pos?
optionalpos?:Model3dPoint
Defined in: src/types/model3d.ts:50
Camera position in metres (am3d:camera/am3d:pos).
Default
ts
{ x: 0, y: 0, z: 2.2630334 }up?
optionalup?:Model3dPoint
Defined in: src/types/model3d.ts:60
Camera "up" direction (am3d:camera/am3d:up). Need not be normalized.
Default
ts
{ x: 0, y: 1, z: 0 }