This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -----JS CODE----- | |
// LENS STUDIO | |
// When camera is within the specified distance of this object, | |
// rotate to face the camera at the specified lerp value. | |
// When the camera is outside the distance, rotate back to original rotation. | |
// @input SceneObject cameraObject | |
// @input float triggerDistance = 135 | |
// @input float lerpValue = .05 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -----JS CODE----- | |
// PLANE TRACKER | |
// For Lens Studio on Next Generation Spectacles | |
// - Gets plane tracking data | |
// - Determines if a tracked plane is valid or not, based on settings | |
// - If valid, sets position, normal, and calculated rotation | |
// Ted Brown / November 30, 2021 | |
// @input SceneObject cameraObject | |
// @input string floor = "head" {"widget":"combobox", "values":[{"label":"Disabled", "value":"disabled"}, {"label":"Default Rotation", "value":"default"}, {"label":"Head Rotation", "value":"head"}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -----JS CODE----- | |
// PLANE TRACKER EXAMPLE | |
// For Lens Studio on Next Generation Spectacles | |
// Requires Plane Tracker script: https://gist.github.com/tedbrownxr/64914f814b0d121a9f53f66e5ecf2350 | |
// - Uses Plane Tracker to position an object in the world | |
// - If the plane is invalid, hides the object and shows the problem with on-screen text | |
// - Activates on start | |
// - Tap to set object position | |
// Ted Brown / November 30, 2021 |