-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprojection_demo.html
43 lines (42 loc) · 1.25 KB
/
projection_demo.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
<html>
<head>
<script type="text/javascript" src="sylvester.js"></script>
<script type="text/javascript" src="projection.js"></script>
<script type="text/javascript">
function testing(){
var c = document.getElementById("canvas");
var eng = new PEngine(c);
//var t = setInterval("demo()",1000);
}
function togglePerspectiveProjection(){
if (window.pengine.perspective){
window.pengine.setPerspective(false);
document.getElementById("perspectiveButton").innerHTML = "enable perspective projection";
}else{
window.pengine.setPerspective(true);
document.getElementById("perspectiveButton").innerHTML = "disable perpective projection";
}
}
</script>
</head>
<body onload = "testing();">
<br>
<br>
<br>
<br>
<div align="center">
<button id= "perspectiveButton" onclick="togglePerspectiveProjection()" >
disable perspective projection
</button>
<button onclick="window.pengine.renderImage()" >
render
</button>
<br>
<canvas id="canvas" width="300" height="300" style="border:solid;">
projection canvas
</canvas>
</div>
<div id="debug">
</div>
</body>
</html>