*: simulate color gradient

This commit is contained in:
tym2k1 2025-02-22 02:27:29 +01:00
parent 2c9514f7fa
commit 3fa5b4f4c6
No known key found for this signature in database
GPG key ID: 409330E8D7E4BF83
2 changed files with 30439 additions and 5 deletions

30425
assets/onion_stroke.obj Normal file

File diff suppressed because it is too large Load diff

View file

@ -111,16 +111,14 @@ class OrbitingObject {
}
function preload() {
onion = loadModel('./assets/onion.obj');
onion = loadModel('./assets/onion_stroke.obj');
font = loadFont('./assets/jgs5.ttf');
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
angleMode(DEGREES);
ambientMaterial(0, 0, 0, 0);
stroke(255);
strokeWeight(0.5);
noStroke();
textFont(font, 60);
textAlign(CENTER, CENTER);
randomSeed()
@ -142,8 +140,19 @@ function setup() {
function draw() {
background(0);
noFill();
orbitControl();
shininess(0);
specularMaterial(255, 255, 255);
directionalLight(
210, 0, 255, // color
180, 180, 0 // direction
);
directionalLight(
0, 255, 180, // color
-180, -180, 0 // direction
);
// Update the onion object
onionObj.update();