*: simulate color gradient
This commit is contained in:
parent
2c9514f7fa
commit
3fa5b4f4c6
30425
assets/onion_stroke.obj
Normal file
30425
assets/onion_stroke.obj
Normal file
File diff suppressed because it is too large
Load diff
19
sketch.js
19
sketch.js
|
|
@ -111,16 +111,14 @@ class OrbitingObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
function preload() {
|
function preload() {
|
||||||
onion = loadModel('./assets/onion.obj');
|
onion = loadModel('./assets/onion_stroke.obj');
|
||||||
font = loadFont('./assets/jgs5.ttf');
|
font = loadFont('./assets/jgs5.ttf');
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
createCanvas(windowWidth, windowHeight, WEBGL);
|
createCanvas(windowWidth, windowHeight, WEBGL);
|
||||||
angleMode(DEGREES);
|
angleMode(DEGREES);
|
||||||
ambientMaterial(0, 0, 0, 0);
|
noStroke();
|
||||||
stroke(255);
|
|
||||||
strokeWeight(0.5);
|
|
||||||
textFont(font, 60);
|
textFont(font, 60);
|
||||||
textAlign(CENTER, CENTER);
|
textAlign(CENTER, CENTER);
|
||||||
randomSeed()
|
randomSeed()
|
||||||
|
|
@ -142,8 +140,19 @@ function setup() {
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
background(0);
|
background(0);
|
||||||
noFill();
|
|
||||||
orbitControl();
|
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
|
// Update the onion object
|
||||||
onionObj.update();
|
onionObj.update();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue