-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
49 lines (39 loc) · 1.24 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Sphere</title>
<link rel="stylesheet" type="text/css" href="css/sphere.css">
<script src="js/graphics3d.js"></script>
</head>
<body>
<!-- Canvas -->
<canvas id="myCanvas"></canvas>
<script type="text/javascript">
document.onreadystatechange = function() {
// Set canvas width and height to full screen,
var myCanvas = document.getElementById("myCanvas");
myCanvas.width = document.body.clientWidth;
myCanvas.height = document.body.clientHeight;
// X and Y rotation angle (RAD)
var theta = -1;
var phi = 0;
// Field of view (RAD)
var fov = .7;
var solid = true;
// Sphere aspect
var colorLatitude = [200, 50, 0];
var colorLongitude = [255, 0, 0];
var radius = 100;
var distancePoints = .01 // (RAD angle)
var latitudeSegments = 20;
var longitudeSegments = 20;
// Class instantiation
var g = new Graphics3d("myCanvas", theta, phi, fov, solid);
// Clear
g.clear();
// Draw Sphere
g.drawSphere(colorLatitude, colorLongitude, radius, distancePoints, latitudeSegments, longitudeSegments);
}
</script>
</body>
</html>