-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvrhtml-example1.html
More file actions
118 lines (98 loc) · 3.31 KB
/
vrhtml-example1.html
File metadata and controls
118 lines (98 loc) · 3.31 KB
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
116
117
118
<!DOCTYPE html>
<script>
/*
This is an example html file to demonstrate how to use vrhtml.js.
For more information see vrhtml.js
*/
</script>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background-color: #333333;
margin: 0;
overflow: hidden;
font-family: verdana;
font-size: 10px;
}
#eye-container {
width: 100%;
height: 100%;
position: absolute;
}
.eye-mask {
background-color: #000;
width: 50%;
height: 100%;
position: absolute;
overflow: hidden;
}
.renderer {
position: absolute;
top: 0;
width: 50%;
border: solid 1px #666666;
overflow: hidden;
backgroundColor: black;
}
#meta-panel {
position: absolute;
width: 100%;
height: 25%;
bottom: 0px;
background: #c2ccd1;
opacity: 0.7;
}
#trace {
position: absolute;
right: 0px;
top: 0px;
width: 50%;
height: 100%;
overflow: hidden;
background: #b2bcc1;
}
</style>
</head>
<body style="padding-right:0px;padding-left:0px;">
<script src="libs/three.js"></script>
<script src="libs/TrackballControls.js"></script>
<script src="libs/CSS3DRenderer.js"></script>
<script src="libs/vr.js"></script>
<script src="js/vrhtml.js"></script>
<div id="eye-container">
<div id="eye-mask-left" class="eye-mask" style="left:0px;"></div>
<div id="eye-mask-right" class="eye-mask" style="right:0px;"></div>
</div>
<div id="meta-panel">
<strong>O</strong> and <strong>P</strong>: Change eye separation.<br/>
<input type="radio" id="controlModeMouse" name="controlMode" value="mouse" checked>Mouse Control<br>
<input type="radio" id="controlModeVR" name="controlMode" value="vr">VR Headset Control<br>
<div id="trace">
</div>
</div>
<div id="htmlModelPrototype" style="background:yellow;-webkit-transform-style: preserve-3d;">
Hello I am test Item!
<form action="">
<fieldset>
<legend>Personal information:</legend>
Name: <input type="text" size="30" value="Hiro Protagonist" style="-webkit-transform:translateZ(10px);"><br>
E-mail: <input type="text" size="30" style="-webkit-transform:translateZ(10px);"><br>
Date of birth: <input type="text" size="10" style="-webkit-transform:translateZ(10px);">
</fieldset>
</form>
<div class="test3d-a"
style="background:red;width:50px;height:50px;-webkit-transform:translateZ(20px) rotate3d(0.1,0.3,0,45deg);-webkit-transform-style: preserve-3d;"></div>
<div class="test3d-b"
style="background:blue;width:50px;height:50px;-webkit-transform:translateZ(100px);-webkit-transform-style: preserve-3d;"></div>
</div>
<script>
// Two options to start:
// If you do not have the 'npvr' vr.js plugin in your browser: https://github.com/benvanik/vr.js
//document.body.onload = window.vrhtml.startWithoutNPVR("htmlModelPrototype");
// If you DO have the vr.js plugin in your browser.
vrhtml.start("htmlModelPrototype");
</script>
</body>
</html>