content/hifi-public/sam/scripts/turntable/turnTable.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

64 lines
No EOL
1.8 KiB
JavaScript

//
// turnTable.js
//
// Created by Sam Gateau on March 22, 2016
// Copyright 2016 High Fidelity, Inc.
//
// Create a turn table zone entity and a spot light centered on the avatar and controls to look at the aavatar in a controled lighting environment
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
var avatarPosition = Vec3.sum(MyAvatar.position, Quat.getFront(Camera.getOrientation()));
var zoneEntityA = Entities.addEntity({
type: "Zone",
position: avatarPosition,
dimensions: { x: 20, y: 20, z: 20 },
keyLightColor: { red: 255, green: 255, blue: 255 },
stageSunModelEnabled: false,
shapeType: "sphere",
backgroundMode: "skybox",
skybox: {
color: { red: 0, green: 0, blue: 125 },
url: ""
},
stage: {
sunModelEnabled: false
}
});
var sphereID = Entities.addEntity({
type: "Sphere",
position: avatarPosition ,
dimensions: { x: 0.1, y: 0.1, z: 0.1 },
color: { red: 255, green: 255, blue: 0 }
});
var lightID = Entities.addEntity({
type: "Light",
position: avatarPosition,
orientation:
dimensions: { x: 10, y: 10, z: 10 },
angularVelocity: { x: 0, y: 0, z: 0 },
angularDamping: 0,
intensity: 2,
isSpotlight: true,
diffuseColor: { red: 255, green: 255, blue: 0 },
constantAttenuation: 0,
linearAttenuation: 1,
quadraticAttenuation: 0,
exponent: 1,
cutoff: 90, // in degrees
});
Script.scriptEnding.connect(function() {
print("Deleted sphere and light");
Entities.deleteEntity(sphereID);
Entities.deleteEntity(lightID);
Entities.deleteEntity(zoneEntityA);
});