Skip to content

Instantly share code, notes, and snippets.

@cozza13
Created December 9, 2016 00:09
Show Gist options
  • Save cozza13/aa51e5005d0484309516f0783b767109 to your computer and use it in GitHub Desktop.
Save cozza13/aa51e5005d0484309516f0783b767109 to your computer and use it in GitHub Desktop.
print("$$$$$$$ Create Web overlay");
var dimensions = { x: 4, y: 3 };
var METERS_TO_INCHES = 39.3701;
// Web overlays are size by resolution and DPI (not dimensions).
var webOverlay = Overlays.addOverlay("web3d", {
url: "https://highfidelity.com/marketplace?category=architecture",
//dimensions: { x: 0.5, y: 0.5 }, // The dimensions propery scales the overlay rather than sets its size!
position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: -2.5, y: 0.75, z: -8 })),
//position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.5, z: -7 })),
rotation: MyAvatar.orientation,
resolution: { x: 720, y: 540 },
dpi: 720 / (4 * METERS_TO_INCHES),
color: { red: 255, green: 255, blue: 255 },
alpha: 1.0
});
//var rectangleOverlay = Overlays.addOverlay("rectangle3d", {
// dimensions: { x: 4.1, y: 3.1 },
// position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: -2.5, y: 0.5, z: -8.01 })),
// rotation: MyAvatar.orientation,
// color: { red: 255, green: 0, blue: 0 },
// alpha: 1.0
//});
function onScriptEnding() {
print("$$$$$$$ Delete Web overlay")
Overlays.deleteOverlay(webOverlay);
//Overlays.deleteOverlay(rectangleOverlay);
}
Script.scriptEnding.connect(onScriptEnding);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment