Even if we are a simulated reality, there is no way to be sure the beings running the simulation are not themselves a simulation, and the operators of that simulation are not a simulation. - David Deutsch
A Pen by Karl Lindberg on CodePen.
<canvas></canvas> | |
<!-- Click to generate a new image --> |
Even if we are a simulated reality, there is no way to be sure the beings running the simulation are not themselves a simulation, and the operators of that simulation are not a simulation. - David Deutsch
A Pen by Karl Lindberg on CodePen.
"use strict"; | |
{ | |
const code = { | |
setup() { | |
this.render({ | |
startShape: 'WHOLE', | |
transform: {s: 4, b: 0.7}, | |
background: '#333', | |
minSize: 0.2, | |
fov: 60, | |
camDist: 8, | |
lightPosition: [0.0, 0.0, -8.0], | |
ambientColor: [0.12, 0.12, 0.12], | |
specularColor: [1.5, 1.0, 0.25], | |
diffuseColor: [0.25, 0.5, 1.2], | |
shininess: 6 | |
}); | |
}, | |
rules() { | |
return { | |
WHOLE: s => { | |
this.QUAD(s, {x: -0.5, y: -0.5, z: -0.5}); | |
this.QUAD(s, {x: 0.5, y: -0.5, z: -0.5}); | |
this.QUAD(s, {x: -0.5, y: 0.5, z: -0.5}); | |
this.QUAD(s, {x: 0.5, y: 0.5, z: -0.5}); | |
this.QUAD(s, {x: -0.5, y: -0.5, z: 0.5}); | |
this.QUAD(s, {x: 0.5, y: -0.5, z: 0.5}); | |
this.QUAD(s, {x: -0.5, y: 0.5, z: 0.5}); | |
//this.QUAD(s, {x: 0.5, y: 0.5, z: 0.5}); | |
}, | |
QUAD: [ | |
1, s => { | |
this.CUBE(s, {ry: this.randpos([0, 90])}); | |
}, | |
5, s => { | |
this.WHOLE(s, {s: 0.45}); | |
}, | |
0.5, s => {} | |
] | |
}; | |
} | |
}; | |
// import cfdg library | |
cfdg.apply(code); | |
// run code | |
code.setup(); | |
// Click canvas to generate a new image | |
["click", "touchdown"].forEach(event => { | |
document.addEventListener(event, e => code.setup(), false); | |
}); | |
} |
<script src="https://codepen.io/ge1doot/pen/rdwPLr/"></script> |
html, body { | |
overflow: hidden; | |
touch-action: none; | |
position: absolute; | |
margin: 0; | |
padding: 0; | |
width: 100%; | |
height: 100%; | |
background: #000; | |
} | |
canvas { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
user-select: none; | |
cursor: pointer; | |
background: #000; | |
} |