Add sun glitter

This commit is contained in:
Julian
2020-01-29 21:23:25 +01:00
parent f9408474a2
commit 1f8e050bb5
2 changed files with 20 additions and 15 deletions

View File

@@ -374,16 +374,13 @@ function drawScene() {
mat4.identity(projection);
mat4.perspective(projection, 1.0, viewportWidth / viewportHeight, 0.1, 1000.); //projection mode should actually be camera specific
camera.setOffset(15.0);
camera.setOffset(1.2);
camera.setRotationX((curRotX += mouseYVel * 0.001));
camera.setRotationY((curRotY += mouseXVel * 0.001));
var view = camera.getViewMatrix();
var model = mat4.create();
mat4.identity(model);
let xyScaling = vec3.create();
vec3.set(xyScaling, 10., 10., 1.0);
mat4.scale(model, model, xyScaling); //2. Then scale the surface xy by factor 10
let translationCentering = vec3.create();
vec3.set(translationCentering, -0.5, -0.5, 0.0);
mat4.translate(model, model, translationCentering); //1. First Center the Surface in the origin.