48 lines
No EOL
1.4 KiB
JavaScript
48 lines
No EOL
1.4 KiB
JavaScript
(function() { // Robin's rainbow jacket
|
|
|
|
|
|
var b = Entities.addEntity({
|
|
parentID: MyAvatar.sessionUUID,
|
|
name: "_robins_jacket",
|
|
type: "Material",
|
|
materialURL: "https://hifi-content.s3.amazonaws.com/robin/robinStuff/photos/RobinsRainbowMaterial.json",
|
|
parentMaterialName: "1",
|
|
priority: 1,
|
|
position: MyAvatar.position},
|
|
true);
|
|
var t = 0;
|
|
Script.update.connect(function(dt) {
|
|
Entities.editEntity(b, {
|
|
materialMappingPos: {
|
|
x:Math.cos(t*0.08),
|
|
y: Math.sin(t*0.05)
|
|
},
|
|
materialMappingScale: {
|
|
x:Math.sin(dt*0.08) + 0.1,
|
|
y:Math.sin(dt*0.06) + 0.1
|
|
}
|
|
});
|
|
t = t + dt;
|
|
})
|
|
|
|
|
|
// RED HAIR
|
|
var hair = Entities.addEntity({
|
|
type: "Material",
|
|
name: "_robins_hair",
|
|
parentID: MyAvatar.sessionUUID,
|
|
materialURL: "materialData",
|
|
priority: 1,
|
|
// opacity: 1,
|
|
materialData: JSON.stringify({
|
|
materialVersion: 1,
|
|
materials: {
|
|
"model": "hifi_pbr",
|
|
"albedoMap": "http://hifi-content.s3-us-west-1.amazonaws.com/robin/robinStuff/photos/red-hair.jpg"
|
|
},
|
|
"emissiveMap": "http://hifi-content.s3-us-west-1.amazonaws.com/robin/robinStuff/photos/red-hair.jpg"
|
|
}),
|
|
}, true);
|
|
|
|
}()
|
|
); // END LOCAL_SCOPE
|