()
| 45 | |
| 46 | let lastScene = -1 |
| 47 | function draw() { |
| 48 | const period = 8000 |
| 49 | |
| 50 | const ms = millis() |
| 51 | const scene = floor(ms / period) |
| 52 | if (scene !== lastScene) { |
| 53 | regenerate() |
| 54 | lastScene = scene |
| 55 | } |
| 56 | |
| 57 | const t = (ms % period)/period |
| 58 | background(0) |
| 59 | orbitControl() |
| 60 | const s = map(t, 0, 0.2, 0, 1, true) * map(t, 0.8, 1, 1, 0, true) |
| 61 | directionalLight(s*255, s*255, s*255, -0.4, 0, 1) |
| 62 | directionalLight(s*255, s*255, s*255, 0.4, 0, 1) |
| 63 | directionalLight(s*255, s*255, s*255, 0, -0.4, 1) |
| 64 | directionalLight(s*255, s*255, s*255, 0, 0.4, 1) |
| 65 | noStroke() |
| 66 | fill(100) |
| 67 | specularMaterial(255) |
| 68 | shininess(400) |
| 69 | scale(0.8) |
| 70 | rotateY(millis() * 0.0001) |
| 71 | model(geom) |
| 72 | } |
| 73 | |
| 74 | function mousePressed(){ |
| 75 | //only type-checking the relevant properties exist on the mouseButton object type. |
nothing calls this directly
no test coverage detected