overte-HifiExperiments/scripts/developer/utilities/render/debugSelfie.js
2017-05-14 15:24:35 -07:00

52 lines
1.7 KiB
JavaScript

function addOne() {
var newOverlay = Overlays.addOverlay("image", {
x: 100, y: 100, width: 500, height: 250,
// imageURL: "http://selfieFrame",
imageURL: "http://1.bp.blogspot.com/-1GABEq__054/T03B00j_OII/AAAAAAAAAa8/jo55LcvEPHI/s1600/Winning.jpg",
alpha: 1.0
});
}
function offset() {
var orientation = MyAvatar.orientation;
orientation = Quat.safeEulerAngles(orientation);
orientation.x = 0;
orientation = Quat.fromVec3Degrees(orientation);
return Vec3.sum(MyAvatar.position, Vec3.multiply(5, Quat.getForward(orientation)));
}
function addTwo() {
return Overlays.addOverlay("image3d", {
//url: kickOverlayURL(),
url: "http://selfieFrame",
//url: "http://1.bp.blogspot.com/-1GABEq__054/T03B00j_OII/AAAAAAAAAa8/jo55LcvEPHI/s1600/Winning.jpg",
position: offset(),
size: 1,
scale: -5.0,
color: { red: 255, green: 255, blue: 255},
alpha: 1,
solid: true,
isFacingAvatar: true,
drawInFront: false,
parentID: MyAvatar.sessionUUID
});
}
var newOverlay = addTwo();
var config = Render.getConfig("SelfieFrame");
function updateCamera() {
//config.position = offset();
//config.orientation = MyAvatar.orientation;
}
var size = Controller.getViewportDimensions();
config.resetSize(size.x, size.y);
Script.update.connect(updateCamera);
config.enabled = true;
Script.scriptEnding.connect(function () {
config.enabled = false;
Script.update.disconnect(updateCamera);
Overlays.deleteOverlay(newOverlay);
})