archive 001 and 002 as early prototypes
This commit is contained in:
parent
87563cb9e3
commit
778873c9ce
12 changed files with 85 additions and 15 deletions
|
@ -39,12 +39,11 @@ console.log(chalk.green`>> Generating HTML and Markdown ...`);
|
||||||
await generate(works);
|
await generate(works);
|
||||||
|
|
||||||
console.log(chalk.green`>> Copying public files ...`);
|
console.log(chalk.green`>> Copying public files ...`);
|
||||||
const publics = globSync("src/public/*");
|
const { stdout, stderr, exitCode } = Bun.spawnSync([
|
||||||
for (const file of publics) {
|
"sh",
|
||||||
const dest = file.replace("src/public/", "html/");
|
"-c",
|
||||||
cpSync(file, dest);
|
"cp -r src/public/* html/",
|
||||||
console.log(chalk.yellow(` -> ${dest}...`));
|
]);
|
||||||
}
|
|
||||||
|
|
||||||
console.log(chalk.green`>> Convert meshes ...`);
|
console.log(chalk.green`>> Convert meshes ...`);
|
||||||
await convertMeshes();
|
await convertMeshes();
|
||||||
|
|
File diff suppressed because one or more lines are too long
2
html/chunk-34454e0a94287d20.js
Normal file
2
html/chunk-34454e0a94287d20.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,5 @@
|
||||||
|
// This one is archived.
|
||||||
|
|
||||||
import { Shader } from "./shader";
|
import { Shader } from "./shader";
|
||||||
import { BasicPlane } from "./basic-plane";
|
import { BasicPlane } from "./basic-plane";
|
||||||
import { App } from "./app";
|
import { App } from "./app";
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// This one is archived.
|
||||||
import { MeshRenderer } from "../renderer/mesh-renderer";
|
import { MeshRenderer } from "../renderer/mesh-renderer";
|
||||||
import plane from "../meshes/plane";
|
import plane from "../meshes/plane";
|
||||||
import { WebGLApp } from "../renderer/webgl";
|
import { WebGLApp } from "../renderer/webgl";
|
||||||
|
@ -14,21 +15,19 @@ const camera = new Transform(
|
||||||
quat.fromEuler(quat.create(), 15, 0, 0)
|
quat.fromEuler(quat.create(), 15, 0, 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
(window as any).ANGLE_X = 15;
|
const modelTransform = new Transform([0, 0, 4]);
|
||||||
(window as any).ANGLE_Y = 0;
|
|
||||||
(window as any).ANGLE_Z = 0;
|
|
||||||
|
|
||||||
app.onUpdate((time: number) => {
|
app.onUpdate((time: number) => {
|
||||||
const stride = 2;
|
const cameraStride = 3;
|
||||||
const x = Math.sin(time * 0.0001) * (stride * 2 - stride * 0.5);
|
const x = Math.sin(time * 0.0001) * (cameraStride * 2 - cameraStride * 0.5);
|
||||||
// const y = Math.tan(time * 0.001) * (stride * 2 - stride * 0.5);
|
|
||||||
|
|
||||||
camera.rotation = quat.fromEuler(quat.create(), x, 0, 0);
|
camera.rotation = quat.fromEuler(quat.create(), x, 0, 0);
|
||||||
|
// modelTransform.rotation = quat.fromEuler(quat.create(), x, 0, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
new Renderable(
|
new Renderable(
|
||||||
app,
|
app,
|
||||||
new Transform([0, 0, 4]),
|
modelTransform,
|
||||||
new MeshRenderer(app, torus, uvRainbow(app), camera, {
|
new MeshRenderer(app, torus, uvRainbow(app), camera, {
|
||||||
drawMode: app.gl.TRIANGLE_FAN,
|
drawMode: app.gl.TRIANGLE_FAN,
|
||||||
})
|
})
|
||||||
|
|
14
src/meshes/torus-scuffed.ts
Normal file
14
src/meshes/torus-scuffed.ts
Normal file
File diff suppressed because one or more lines are too long
25
src/public/001-platform-provenance/index.html
Normal file
25
src/public/001-platform-provenance/index.html
Normal 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>
|
1
src/public/001-platform-provenance/main.js
Normal file
1
src/public/001-platform-provenance/main.js
Normal file
File diff suppressed because one or more lines are too long
25
src/public/002-webgl-engine/index.html
Normal file
25
src/public/002-webgl-engine/index.html
Normal 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>
|
1
src/public/002-webgl-engine/main.js
Normal file
1
src/public/002-webgl-engine/main.js
Normal file
File diff suppressed because one or more lines are too long
2
src/public/chunk-1da54319833c650d.js
Normal file
2
src/public/chunk-1da54319833c650d.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -42,7 +42,7 @@ export class Telemetry extends Behavior {
|
||||||
} | U: ${this.app.registry.onUpdate.length} | aU: ${
|
} | U: ${this.app.registry.onUpdate.length} | aU: ${
|
||||||
this.app.registry.onAfterUpdate.length
|
this.app.registry.onAfterUpdate.length
|
||||||
}`;
|
}`;
|
||||||
}, 1000);
|
}, 1001);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAfterUpdate(time: number) {
|
onAfterUpdate(time: number) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue