SceneModule Overview
SceneModule Overview
FocalPlane

FocalPlane

The FocalPlane class exposes details about the focal plane of the device camera.

Example

//============================================================================
// The following example demonstrates how to bind a Plane to the Focal Plane
// of the Camera using signals.
//
// Project setup:
// - Add the Scripting Dynamic Instantiation capability
//============================================================================

// Load in the required module
const Scene = require('Scene');

(async function () {  // Enables async/await in JS [part 1]

  // Locate the Camera
  const camera = await Scene.root.findFirst('Camera');

  // Create a Plane object
  const plane = await Scene.create("Plane", {
    "name": "plane0"
  });

  // Add the plane to the Camera space
  camera.addChild(plane);

  // Manually make the plane occupy the focal plane of the Camera.
  plane.width = camera.focalPlane.width;
  plane.height = camera.focalPlane.height;

  // Setting the Z axis here is equivalent to adding the Plane
  // as a child of the Focal Distance.
  plane.transform.z = camera.focalPlane.distance.mul(Reactive.val(-1));

})(); // Enables async/await in JS [part 2]

Properties

PropertyDescription
distance
(get) distance: ScalarSignal
(set) (Not Available)


Specifies the distance between focal plane and camera. Measured in 3D units.
height
(get) height: ScalarSignal
(set) (Not Available)


Specifies the height of the focal plane. Measured in 3D units.
width
(get) width: ScalarSignal
(set) (Not Available)


Specifies the width of the focal plane. Measured in 3D units.

Methods

This module exposes no methods.

Was this article helpful?