The FocalPlane
class exposes details about the focal plane of the device camera.
//============================================================================ // 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]
Property | Description |
---|---|
distance | (get) distance: ScalarSignal Specifies the distance between focal plane and camera. Measured in 3D units. |
height | (get) height: ScalarSignal Specifies the height of the focal plane. Measured in 3D units. |
width | (get) width: ScalarSignal Specifies the width of the focal plane. Measured in 3D units. |
This module exposes no methods.