archive 001 and 002 as early prototypes

This commit is contained in:
41666 2023-10-09 00:05:02 -04:00
parent 87563cb9e3
commit 778873c9ce
12 changed files with 85 additions and 15 deletions

View file

@ -39,12 +39,11 @@ console.log(chalk.green`>> Generating HTML and Markdown ...`);
await generate(works);
console.log(chalk.green`>> Copying public files ...`);
const publics = globSync("src/public/*");
for (const file of publics) {
const dest = file.replace("src/public/", "html/");
cpSync(file, dest);
console.log(chalk.yellow(` -> ${dest}...`));
}
const { stdout, stderr, exitCode } = Bun.spawnSync([
"sh",
"-c",
"cp -r src/public/* html/",
]);
console.log(chalk.green`>> Convert meshes ...`);
await convertMeshes();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,5 @@
// This one is archived.
import { Shader } from "./shader";
import { BasicPlane } from "./basic-plane";
import { App } from "./app";

View file

@ -1,3 +1,4 @@
// This one is archived.
import { MeshRenderer } from "../renderer/mesh-renderer";
import plane from "../meshes/plane";
import { WebGLApp } from "../renderer/webgl";
@ -14,21 +15,19 @@ const camera = new Transform(
quat.fromEuler(quat.create(), 15, 0, 0)
);
(window as any).ANGLE_X = 15;
(window as any).ANGLE_Y = 0;
(window as any).ANGLE_Z = 0;
const modelTransform = new Transform([0, 0, 4]);
app.onUpdate((time: number) => {
const stride = 2;
const x = Math.sin(time * 0.0001) * (stride * 2 - stride * 0.5);
// const y = Math.tan(time * 0.001) * (stride * 2 - stride * 0.5);
const cameraStride = 3;
const x = Math.sin(time * 0.0001) * (cameraStride * 2 - cameraStride * 0.5);
camera.rotation = quat.fromEuler(quat.create(), x, 0, 0);
// modelTransform.rotation = quat.fromEuler(quat.create(), x, 0, 0);
});
new Renderable(
app,
new Transform([0, 0, 4]),
modelTransform,
new MeshRenderer(app, torus, uvRainbow(app), camera, {
drawMode: app.gl.TRIANGLE_FAN,
})

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>com.mekanoe.art // 001-platform-provenance</title>
<style>
html,
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: black;
color: white;
}
main {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
<link rel="stylesheet" href="/work.css" />
<main>
<canvas id="canvas" width="1280" height="720"></canvas>
<div id="telemetry">XX.X FPS (XX.X ms)</div>
</main>
<script src="/001-platform-provenance/main.js" type="module"></script>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>com.mekanoe.art // 002-webgl-engine</title>
<style>
html,
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: black;
color: white;
}
main {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
<link rel="stylesheet" href="/work.css" />
<main>
<canvas id="canvas" width="1280" height="720"></canvas>
<div id="telemetry">XX.X FPS (XX.X ms)</div>
</main>
<script src="/002-webgl-engine/main.js" type="module"></script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -42,7 +42,7 @@ export class Telemetry extends Behavior {
} | U: ${this.app.registry.onUpdate.length} | aU: ${
this.app.registry.onAfterUpdate.length
}`;
}, 1000);
}, 1001);
}
onAfterUpdate(time: number) {