xxxxxxxxxx
let dayImg, nightImg;
let angle = 0;
function preload() {
dayImg = loadImage('2k_earth_daymap.jpg');
nightImg = loadImage('2k_earth_nightmap.jpg');
}
function setup() {
frameRate(30);
createCanvas(windowWidth, windowHeight, WEBGL);
// blendMode(SOFT_LIGHT);
// dayImg.blend(nightImg, 0, 0, dayImg.width, dayImg.height, 0, 0, nightImg.width, nightImg.height, ADD);
}
function draw() {
orbitControl();
// rotateX(angle);
rotateY(angle);
// rotateZ(angle);
perspective();
background(0);
noStroke();
ambientLight(60);
pointLight(255,255,255, mouseX, mouseY, 200);
ambientMaterial(255);
texture(dayImg);
textureMode(NORMAL);
sphere(100);
texture(nightImg);
textureMode(NORMAL);
sphere(100);
angle+= 0.05;
}