This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
147 lines (144 loc) · 5.45 KB
/
index.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="model.json.js"></script>
<script type="text/javascript" src="math.js"></script>
<script type="text/javascript" src="index.js"></script>
<title>Phong Reflection Sample</title>
</head>
<body>
<div id="canvas-wrapper">
<canvas id="canvas"></canvas>
</div>
<div id="parameters-wrapper">
<details>
<summary>Model</summary>
<table>
<tr>
<th>parameter</th>
<th>x</th>
<th>y</th>
<th>z</th>
</tr>
<tr>
<td>position</td>
<td><input type="number" id="model-position-x" value="0"></td>
<td><input type="number" id="model-position-y" value="-3"></td>
<td><input type="number" id="model-position-z" value="0"></td>
</tr>
<tr>
<td>rotated</td>
<td><input type="number" id="model-rotated-x" value="90"></td>
<td><input type="number" id="model-rotated-y" value="0"></td>
<td><input type="number" id="model-rotated-z" value="0"></td>
</tr>
<tr>
<td>rotating</td>
<td><input type="number" id="model-rotating-x" value="0"></td>
<td><input type="number" id="model-rotating-y" value="1"></td>
<td><input type="number" id="model-rotating-z" value="0"></td>
</tr>
</table>
</details>
<details>
<summary>Camera</summary>
<table>
<tr>
<th>parameter</th>
<th>x</th>
<th>y</th>
<th>z</th>
</tr>
<tr>
<td>position</td>
<td><input type="number" id="camera-position-x" value="0"></td>
<td><input type="number" id="camera-position-y" value="15"></td>
<td><input type="number" id="camera-position-z" value="15"></td>
</tr>
<tr>
<td>look at</td>
<td><input type="number" id="camera-look-at-x" value="0"></td>
<td><input type="number" id="camera-look-at-y" value="0"></td>
<td><input type="number" id="camera-look-at-z" value="0"></td>
</tr>
<tr>
<td>up vector</td>
<td><input type="number" id="camera-up-vec-x" value="0"></td>
<td><input type="number" id="camera-up-vec-y" value="1"></td>
<td><input type="number" id="camera-up-vec-z" value="0"></td>
</tr>
</table>
</details>
<details>
<summary>Light</summary>
<table>
<tr>
<th>parameter</th>
<th>x(r)</th>
<th>y(g)</th>
<th>z(b)</th>
</tr>
<tr>
<td>position</td>
<td><input type="number" id="light-position-x" value="100"></td>
<td><input type="number" id="light-position-y" value="100"></td>
<td><input type="number" id="light-position-z" value="100"></td>
</tr>
<tr>
<td>ambient</td>
<td><input type="number" id="light-ambient-x" min="0" max="1" step="0.1" value="0.5"></td>
<td><input type="number" id="light-ambient-y" min="0" max="1" step="0.1" value="0.5"></td>
<td><input type="number" id="light-ambient-z" min="0" max="1" step="0.1" value="0.5"></td>
</tr>
<tr>
<td>diffuse</td>
<td><input type="number" id="light-diffuse-x" min="0" max="1" step="0.1" value="0.8"></td>
<td><input type="number" id="light-diffuse-y" min="0" max="1" step="0.1" value="0.8"></td>
<td><input type="number" id="light-diffuse-z" min="0" max="1" step="0.1" value="0.8"></td>
</tr>
<tr>
<td>specular</td>
<td><input type="number" id="light-specular-x" min="0" max="1" step="0.1" value="1.0"></td>
<td><input type="number" id="light-specular-y" min="0" max="1" step="0.1" value="1.0"></td>
<td><input type="number" id="light-specular-z" min="0" max="1" step="0.1" value="1.0"></td>
</tr>
</table>
</details>
<details>
<summary>Material</summary>
<table>
<tr>
<th>parameter</th>
<th>r</th>
<th>g</th>
<th>b</th>
</tr>
<tr>
<td>ambient</td>
<td><input type="number" id="material-ambient-x" min="0" max="1" step="0.1" value="0.2"></td>
<td><input type="number" id="material-ambient-y" min="0" max="1" step="0.1" value="0.2"></td>
<td><input type="number" id="material-ambient-z" min="0" max="1" step="0.1" value="0.2"></td>
</tr>
<tr>
<td>diffuse</td>
<td><input type="number" id="material-diffuse-x" min="0" max="1" step="0.1" value="0.5"></td>
<td><input type="number" id="material-diffuse-y" min="0" max="1" step="0.1" value="0.5"></td>
<td><input type="number" id="material-diffuse-z" min="0" max="1" step="0.1" value="0.5"></td>
</tr>
<tr>
<td>specular</td>
<td><input type="number" id="material-specular-x" min="0" max="1" step="0.1" value="0.8"></td>
<td><input type="number" id="material-specular-y" min="0" max="1" step="0.1" value="0.8"></td>
<td><input type="number" id="material-specular-z" min="0" max="1" step="0.1" value="0.8"></td>
</tr>
<tr>
<td>shininess</td>
<td><input type="number" id="material-shininess" min="0" value="128"></td>
</tr>
</table>
</details>
</div>
</body>
</html>