Rework website with bulma instead of bootstrap #6

Manually merged
tlater merged 43 commits from tlater/bulma2 into master 2022-08-14 00:26:49 +01:00
Showing only changes of commit 14d1f71b2b - Show all commits

View file

@ -5,7 +5,7 @@ import { Cube } from "./cube";
import vertexSource from "./shaders/vertices.glsl"; import vertexSource from "./shaders/vertices.glsl";
import fragmentSource from "./shaders/fragments.glsl"; import fragmentSource from "./shaders/fragments.glsl";
const ROTATION_SPEED = 0.0005; const ROTATION_SPEED = 0.25;
const BACKGROUND_COLOR = [0.0588235294118, 0.0588235294118, 0.0588235294118]; const BACKGROUND_COLOR = [0.0588235294118, 0.0588235294118, 0.0588235294118];
class RendererError extends Error {} class RendererError extends Error {}
@ -20,6 +20,8 @@ class Renderer {
private lastFrameTime: number; private lastFrameTime: number;
private dTime: number; private dTime: number;
private rotation: number;
private buffers: { private buffers: {
indices?: WebGLBuffer; indices?: WebGLBuffer;
positions?: WebGLBuffer; positions?: WebGLBuffer;
@ -47,6 +49,7 @@ class Renderer {
this.lastFrameTime = 0; this.lastFrameTime = 0;
this.dTime = 0; this.dTime = 0;
this.rotation = 0;
this.buffers = {}; this.buffers = {};
} }
@ -161,14 +164,12 @@ class Renderer {
} }
updateMatrices(gl: WebGLRenderingContext, shader: Shader) { updateMatrices(gl: WebGLRenderingContext, shader: Shader) {
this.rotation += (this.dTime / 1000.0) * ROTATION_SPEED;
const modelViewMatrix = mat4.create(); const modelViewMatrix = mat4.create();
mat4.translate(modelViewMatrix, modelViewMatrix, [0.0, 0.0, -1.5]); mat4.translate(modelViewMatrix, modelViewMatrix, [0.0, 0.025, -1.2]);
mat4.rotateX(modelViewMatrix, modelViewMatrix, Math.PI / 6); mat4.rotateX(modelViewMatrix, modelViewMatrix, Math.PI / 16);
mat4.rotateY( mat4.rotateY(modelViewMatrix, modelViewMatrix, this.rotation);
modelViewMatrix,
modelViewMatrix,
this.lastFrameTime * ROTATION_SPEED
);
mat4.translate(modelViewMatrix, modelViewMatrix, [-1.0, 0.0, 0.0]); mat4.translate(modelViewMatrix, modelViewMatrix, [-1.0, 0.0, 0.0]);
gl.uniformMatrix4fv( gl.uniformMatrix4fv(
shader.getUniform("uModelViewMatrix"), shader.getUniform("uModelViewMatrix"),