-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
81 lines (72 loc) · 2.07 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
<!DOCTYPE html>
<html>
<head>
<title>Voyage</title>
<link rel="stylesheet" href="css/voyage.css">
</head>
<body>
<div id="container"></div>
<!-- Shaders: -->
<!-- Halo shader (thanks to Lee Stemkoski: http://stemkoski.github.io/Three.js/Shader-Glow.html) -->
<script id="haloVertexShader" type="x-shader/x-vertex">
uniform vec3 viewVector;
uniform float c;
uniform float p;
varying float intensity;
void main()
{
vec3 vNormal = normalize( normalMatrix * normal );
vec3 vNormel = normalize( normalMatrix * viewVector );
intensity = pow( c - dot(vNormal, vNormel), p );
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
</script>
<script id="haloFragmentShader" type="x-shader/x-vertex">
uniform vec3 glowColor;
varying float intensity;
void main()
{
vec3 glow = glowColor * intensity;
gl_FragColor = vec4( glow, 1.0 );
}
</script>
<!-- Scripts: -->
<script type="text/javascript" src="bower_components/chic/lib/chic.js"></script>
<script type="text/javascript" src="bower_components/threejs/build/three.min.js"></script>
<script type="text/javascript" src="js/voyage.js"></script>
<script type="text/javascript" src="js/planet.js"></script>
<script type="text/javascript" src="js/stars.js"></script>
<script type="text/javascript" src="js/spacefog.js"></script>
<script type="text/javascript" src="js/texture.js"></script>
<script type="text/javascript">
// The voyage starts here...
// Let's try out textures:
/*
var texture = new Texture(512, 512, 'composite', {
textures: [
{
texture: new Texture(512, 512, 'color', {
color: 0xFF0000
})
},
{
texture: new Texture(512, 512, 'noise', {
filters: {brightness: 0.9, contrast: 6},
repeat: true,
debug: true
}),
opacity: 0.5
}
],
debug: true
});
*/
// And composites:
var container = document.querySelector('#container');
var voyage = new Voyage(container);
voyage.animate();
voyage.randomize();
// container.addEventListener('click', voyage.randomize);
</script>
</body>
</html>