*: 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() {
|
||||
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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue