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
| var Scene = require('Scene'); | |
| var R = require('Reactive'); | |
| var TouchGestures = require('TouchGestures'); | |
| var canvas = Scene.root.find('canvas'); | |
| var rect = canvas.child('rect'); | |
| var PIXEL_RATIO = 2.0; // assumes iPhone 8 | |
| TouchGestures.onPinch().subscribe(function (gesture) { |
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
| // How to use this script: | |
| // (1) Create a new AR Studio project | |
| // (2) Add a plane, assign it a material | |
| // (3) Attach an ExternalTexture to the newly created material | |
| // (4) Add an audio source | |
| // (5) Add ExternalVideo capability and whitelist the video domain | |
| // (6) Add a script, paste this code | |
| // (7) Create a new video: var video = new Video('url', texture, audio); | |
| // (8) Call video.play() / video.stop() somewhere in the script |
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
| // How to use this script: | |
| // (1) Create a new AR Studio project | |
| // (2) Add a new PlaneTracker "planeTracker0" | |
| // (3) Add 10 objects as a child of the planeTacker, call them "object0", "object1", etc.. | |
| // (4) Assign a different material to each object | |
| // (5) Import this script | |
| // (6) Run | |
| var S = require('Scene'); | |
| var D = require('Diagnostics'); |
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
| // How to test: | |
| // Create a new project in AR Studio | |
| // Create a new plane as a child of Camera | |
| // Assign a new material to it | |
| // Assign an external texture "externalTexture0" to this material | |
| // Import this script | |
| // Whitelist all the texture domains: s3-eu-west-1.amazonaws.com, maps.googleapis.com, orig00.deviantart.net, dx35vtwkllhj9.cloudfront.net | |
| // Check if those textures work for you... | |
| var D = require('Diagnostics'); |