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.
46 lines
1.3 KiB
JavaScript
46 lines
1.3 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)));
|
|
|
|
//var shaderURL = "file:///E:/Temp/hackaton/thursday/master/hack0.fs";
|
|
var shaderURL = "http://hifi-public.s3.amazonaws.com/sam/hack/master/hack0.fs";
|
|
|
|
var proceduralJSON = {
|
|
"ProceduralEntity": {
|
|
"version":2,
|
|
"shaderUrl": shaderURL,
|
|
"channels":[
|
|
"http://demos.vicomtech.org/volren/aorta-high.jpg",
|
|
"http://demos.vicomtech.org/volren/tf.png"
|
|
],
|
|
"uniforms":{
|
|
"iControlMode": [3.0, 1.0, 0.0, 0.0],
|
|
"iHandPos": [0.0, 0.0, 0.0, -1.0],
|
|
"iTransferFunctionRange": [1.0, 0.0, 1.0, 0.0],
|
|
"iLight": [-1.0, -1.0, 1.0, 1.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
|
|
});
|