content/hifi-public/sam/hack/creatVolumejs.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

45 lines
1.2 KiB
JavaScript

var rotation = Quat.safeEulerAngles(Camera.getOrientation());
rotation = Quat.fromPitchYawRollDegrees(0, rotation.y, 0);
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(6, Quat.getFront(rotation)));
//"shaderUrl":"file:///E:/Temp/hackaton/thursday/hack0.fs",
//"shaderUrl":"file:///E:/Temp/hackaton/thursday/hack0.fs",
var proceduralJSON = {
"ProceduralEntity": {
"version":2,
"shaderUrl":"file:///E:/Temp/hackaton/thursday/hack0.fs",
"channels":[
"http://demos.vicomtech.org/volren/aorta-high.jpg",
"http://demos.vicomtech.org/volren/tf.png"
],
"uniforms":{
"iControlMode": [3.0, 0.0, 0.0, 0.0],
"iHandPos": [0.0, 0.0, 0.0, -1.0],
"iTransferFunctionRange": [0.0, 0.0, 1.0, 0.0]
}
}
}
var theUserData = JSON.stringify(proceduralJSON);
var volumeEntity = Entities.addEntity({
name: 'VolumeEntity',
dimensions: {
x: 10,
y: 10,
z: 10
},
type: 'Box',
position: center,
color: {
red: 255,
green: 255,
blue: 255
},
visible: true,
collisionless: true,
collidesWith: "static,dynamic,kinematic",
userData: theUserData
});