forked from PHerzig/EarthServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_oculus.html
115 lines (92 loc) · 5.61 KB
/
example_oculus.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Earth Demo</title>
<link rel="stylesheet" type="text/css" href="css/x3dom.css" />
<link rel="stylesheet" type="text/css" href="css/earthservergenericclient.css" />
<link rel="stylesheet" type="text/css" href="js-ext/jquery-ui/themes/base/jquery-ui.css">
<script type="text/javascript" src="js-ext/x3dom-full.js"></script>
<script type="text/javascript" src="js-ext/jquery-ui/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js-ext/jquery-ui/ui/jquery-ui.js"></script>
<script src="js/SceneManager.js" type="text/javascript"></script>
<script src="js/Module_Base.js" type="text/javascript"></script>
<script src="js/ElevationGrid.js" type="text/javascript"></script>
<script src="js/Terrain.js" type="text/javascript"></script>
<script src="js/ServerRequest.js" type="text/javascript"></script>
<script src="js/Module_WCPSDemAlpha.js" type="text/javascript"></script>
<script src="js/Module_WCPSDemWCPS.js" type="text/javascript"></script>
<script src="js/Module_WCPSDemWCS.js" type="text/javascript"></script>
<script src="js/Module_WMSDemWCS.js" type="text/javascript"></script>
<script src="js/Module_WMSDemWCPS.js" type="text/javascript"></script>
<script src="js/Module_Sharad.js" type="text/javascript"></script>
<script src="js/UI_jQueryUI.js" type="text/javascript"></script>
<script src="js/AnnotationLayer.js" type="text/javascript"></script>
<script src="js/GapGrid.js" type="text/javascript"></script>
<!--<script src="js/EarthServerClient.js" type="text/javascript"></script>-->
<script type="text/javascript">
// basic setup:
EarthServerGenericClient.MainScene.setOculusRift(true,"58653");
EarthServerGenericClient.MainScene.setDrawCube(true);
EarthServerGenericClient.MainScene.setTimeLog(false);//TimeLogging: outputs time of loading and building the models to the console
EarthServerGenericClient.MainScene.addLightToScene(true);//Adds a light into the scene
// background of the render window
EarthServerGenericClient.MainScene.setBackground("0.8 0.8 0.95 0.4 0.5 0.85 0.3 0.5 0.85 0.31 0.52 0.85","0.9 1.5 1.57","0.8 0.8 0.95 0.4 0.5 0.85 0.3 0.5 0.85 0.31 0.52 0.85","0.9 1.5 1.57");
// custom viewpoints
EarthServerGenericClient.MainScene.addCustomViewPoint("VP_1","780.99875 92.28809 -217.55695");//,"-0.09289 0.99157 0.09036 1.53972");
EarthServerGenericClient.MainScene.addCustomViewPoint("VP_2","351.58603 3.26556 409.55088");//,"-0.36375 0.92067 0.14157 0.59087");
// create the models:
$(document).ready(function()
{
var DoubleWCPS = new EarthServerGenericClient.Model_WCPSDemWCPS();
DoubleWCPS.setName("Double WCPS");
DoubleWCPS.setURLs("http://earthserver.bgs.ac.uk/petascope");
DoubleWCPS.setCoverages("bgs_rs", "os_dtm");
DoubleWCPS.setAreaOfInterest(400000,500000,450000,550000);
DoubleWCPS.setResolution(700,700);
DoubleWCPS.setOffset(0,0.3,0);
DoubleWCPS.setScale(1,0.5,1);
DoubleWCPS.setCoordinateReferenceSystem("http://www.opengis.net/def/crs/EPSG/0/27700");
// add models to the scene
EarthServerGenericClient.MainScene.addModel(DoubleWCPS);
// create the scene: Cube has 50% height compared to width and length
EarthServerGenericClient.MainScene.createScene('x3dScene',"theScene",1,0.5,1 );
EarthServerGenericClient.MainScene.addAnnotationsLayer("Layer1","Double WCPS",70,"1 0 0",35,6,"1 0 0");
EarthServerGenericClient.MainScene.addAnnotationsLayer("Layer2","Double WCPS",70,"0 0 1",35,6,"0 0 1");
EarthServerGenericClient.MainScene.addAnnotationsLayer("Layer3","Double WCPS",70,"0 1 0",35,6,"0 1 0");
EarthServerGenericClient.MainScene.addAnnotationAtPosition("Layer1",420000,520000,"Wow! 3D");
EarthServerGenericClient.MainScene.addAnnotationAtPosition("Layer2",447000,507000,"The Sea");
EarthServerGenericClient.MainScene.addAnnotationAtPosition("Layer3",447000,547000,"The Needles");
EarthServerGenericClient.MainScene.addAnnotationAtPosition("Layer1",407000,507000,"The Hills");
//EarthServerGenericClient.MainScene.addAnnotation("Layer1",200,-30,400,"You can annotate here");
// create the UI and axis labels
//EarthServerGenericClient.MainScene.createUI('x3domUI');
EarthServerGenericClient.MainScene.createAxisLabels("Latitude","Height","Longitude");
});
document.onload = function()
{
// register a progressbar (you can register your own or just delete this lines)
var pb = new EarthServerGenericClient.createProgressBar("progressbar");
EarthServerGenericClient.MainScene.setProgressCallback(pb.updateValue);
// starts loading and creating the models
// here the function starts as soon as the html page is fully loaded
// you can map this function to e.g. a button
EarthServerGenericClient.MainScene.createModels();
};
</script>
</head>
<body id="body">
<div id="x3dom">
<div id="progressbar"></div>
<X3D id="x3d" showlog="false" showstat="false">
<scene id="x3dScene">
<Environment frustumCulling="false"></Environment>
<group id="root">
<group id="theScene" DEF='theScene'></group>
</group>
</scene>
</X3D>
<div id='x3domUI'></div>
</div>
</body>
</html>