Skip to content

Commit

Permalink
this is totally fucked right now
Browse files Browse the repository at this point in the history
  • Loading branch information
diclophis committed Nov 4, 2012
1 parent 8b05d2a commit 3766cd7
Show file tree
Hide file tree
Showing 23 changed files with 6,573 additions and 97 deletions.
97 changes: 7 additions & 90 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,94 +24,12 @@
-webkit-user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
form { display: none; }
</style>
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main()
{
vUv = uv;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
gl_Position = projectionMatrix * mvPosition;
}
</script>
<script id="fragment_shader4x" type="x-shader/x-fragment">
uniform float time;
uniform vec2 resolution;
varying vec2 vUv;
void main(void) {
vec2 position = -1.0 + 2.0 * vUv;
float red = abs( sin( position.x * position.y + time) );
float green = abs( sin( position.x * position.y + time) );
float blue = abs( sin( position.x * position.y + time / 1.1) );
gl_FragColor = vec4( red, green, blue, 1.0 );
#sound-engine {
position: absolute;
top: 0; right: 0;
height: 10%;
}
</script>

<script id="fragment_shader4" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif

uniform float time;
uniform vec2 resolution;

void main( void ) {
/*
vec2 uv = gl_FragCoord.xy / 200.0;
vec3 col = vec3(0.0, 0.0, 0.0);
col = (abs(uv.y*2.0) >= 1.0) ? vec3(1.0, 1.0, 1.0) : vec3(0.0, 0.0, 1.0);
if (abs(uv.y) >= 1.0)
col = vec3(1.0, 0.0, 0.0);
gl_FragColor = vec4(col, 1.0);
*/
vec3 red = vec3(1.0, 0.0, 0.0);
vec3 green = vec3(0.0, 0.0, 1.0);
if (abs(gl_FragCoord.x) >= 1.0) {
gl_FragColor = vec4(red, 1.0);
} else {
gl_FragColor = vec4(green, 1.0);
}
}
</script>

<script id="fragment_shader4y" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform float time;

varying vec2 vUv;

void main(void)
{

vec2 p = -1.0 + 2.0 * vUv;
float a = time*40.0;
float d,e,f,g=1.0/40.0,h,i,r,q;

e=400.0*(p.x*0.5+0.5);
f=400.0*(p.y*0.5+0.5);
i=200.0+sin(e*g+a/150.0)*20.0;
d=200.0+cos(f*g/2.0)*18.0+cos(e*g)*7.0;
r=sqrt(pow(i-e,2.0)+pow(d-f,2.0));
q=f/r;
e=(r*cos(q))-a/2.0;f=(r*sin(q))-a/2.0;
d=sin(e*g)*176.0+sin(e*g)*164.0+r;
h=((f+d)+a/2.0)*g;
i=cos(h+r*p.x/1.3)*(e+e+a)+cos(q*g*6.0)*(r+h/3.0);
h=sin(f*g)*144.0-sin(e*g)*212.0*p.x;
h=(h+(f-e)*q+sin(r-(a+h)/7.0)*10.0+i/4.0)*g;
i+=cos(h*2.3*sin(a/350.0-q))*184.0*sin(q-(r*4.3+a/12.0)*g)+tan(r*g+h)*184.0*cos(r*g+h);
i=mod(i/5.6,256.0)/64.0;
if(i<0.0) i+=4.0;
if(i>=2.0) i=4.0-i;
d=r/350.0;
d+=sin(d*d*8.0)*0.52;
f=(sin(a*g)+1.0)/2.0;
gl_FragColor=vec4(vec3(f*i/1.6,i/2.0+d/13.0,i)*d*p.x+vec3(i/1.3+d/8.0,i/2.0+d/18.0,i)*d*(1.0-p.x),1.0);

}

</script>
</style>
<script src="javascripts/sink.js"></script>
<script src="javascripts/pointer.min.js"></script>
<script src="javascripts/three.min.js"></script>
Expand All @@ -131,8 +49,7 @@
</script>
</head>
<body>
<form id="fullscreen-form">
<input type="submit" value="FULLSCREEN"/>
</form>
<iframe id="sound-engine" src="sound-engine/index.html"/></iframe>
</body>

</html>
21 changes: 14 additions & 7 deletions public/javascripts/ctr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var tick = function() {
var dt = (now - this.then) / 1000;
this.then = now;

if (dt < (tm * 1.1)) {
if (true || dt < (tm * 1.1)) {

if (this.paused == false) {
this.forward_angle += ((this.leftVector.x * 0.00345) * dt);
Expand Down Expand Up @@ -64,10 +64,11 @@ var tick = function() {
//this.camera.position.y = 5;
//this.camera.position.z = this.car_one.position.z;
this.camera.updateProjectionMatrix();
this.dirty = true;
}

//thingy.scene.updateMatrixWorld();
setTimeout(tick.bind(this), tm); //, tm, then, st, forward_angle, foward, car_one, forward_speed, camera, thingy);
//setTimeout(tick.bind(this), tm); //, tm, then, st, forward_angle, foward, car_one, forward_speed, camera, thingy);

};

Expand Down Expand Up @@ -164,9 +165,12 @@ var onWindowResize = function() {
var animate = function() {
//rndr, scne, cmra, sts) {
//, rndr, scne, cmra, sts));
requestAnimationFrame(animate.bind(this));
this.renderer.render(this.scene, this.camera);
this.stats.update();
//requestAnimationFrame(animate.bind(this));
if (this.dirty) {
this.renderer.render(this.scene, this.camera);
this.stats.update();
this.dirty = false;
}
}

var createStats = function() {
Expand Down Expand Up @@ -684,7 +688,8 @@ var run = function(body) {
forward_angle: 0,
renderer: renderer,
scene: scene,
stats: stats
stats: stats,
dirty: false
};

// event listeners
Expand All @@ -693,7 +698,9 @@ var run = function(body) {
renderer.domElement.addEventListener('pointerup', onPointerUp.bind(thingy), false);
window.addEventListener('resize', onWindowResize.bind(thingy), false);
//document.getElementById("fullscreen-form").addEventListener('submit', onContClick, false);
animate.apply(thingy)
//animate.apply(thingy)
window.cheese = animate.bind(thingy);
window.puffs = tick.bind(thingy);
tick.apply(thingy);
});

Expand Down
Loading

0 comments on commit 3766cd7

Please sign in to comment.