-
Notifications
You must be signed in to change notification settings - Fork 182
/
CSG_Museum_4.js
47 lines (30 loc) · 1.33 KB
/
CSG_Museum_4.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// scene/demo-specific variables go here
// called automatically from within initTHREEjs() function (located in InitCommon.js file)
function initSceneData()
{
demoFragmentShaderFileName = 'CSG_Museum_4_Fragment.glsl';
// scene/demo-specific three.js objects setup goes here
sceneIsDynamic = false;
cameraFlightSpeed = 70;
// pixelRatio is resolution - range: 0.5(half resolution) to 1.0(full resolution)
pixelRatio = mouseControl ? 0.75 : 0.75;
EPS_intersect = 0.01;
// set camera's field of view
worldCamera.fov = 60;
focusDistance = 153.0;
apertureChangeSpeed = 5;
// position and orient camera
cameraControlsObject.position.set(0, 20, 150);
///cameraControlsYawObject.rotation.y = 0.0;
// look slightly downward
///cameraControlsPitchObject.rotation.x = -0.4;
} // end function initSceneData()
// called automatically from within the animate() function (located in InitCommon.js file)
function updateVariablesAndUniforms()
{
// clamp camera height for walking on Museum floor
cameraControlsObject.position.y = 20;
// INFO
cameraInfoElement.innerHTML = "FOV: " + worldCamera.fov + " / Aperture: " + apertureSize.toFixed(2) + " / FocusDistance: " + focusDistance + "<br>" + "Samples: " + sampleCounter;
} // end function updateUniforms()
init(); // init app and start animating