Fixed #1. Added isomorphic lattice sampler

This commit is contained in:
2025-07-23 15:57:04 +02:00
parent 4eb0f06e3f
commit a7b6a93680
3 changed files with 91 additions and 6 deletions

View File

@@ -1,9 +1,8 @@
//Create useful variables
const aspect = W / H;
const scale = aspect >= 1 ? H / 2 : W / 2;
function setup() {
const [W, H] = [400, 400];
const aspect = W / H;
const scale = aspect >= 1 ? H / 2 : W / 2;
canvas.width = W;
canvas.height = H;
@@ -39,9 +38,8 @@ setup();
const { Bitfield_Image_Sampler } = await import('../lib/image-functions.js');
//Load
const sampler = Bitfield_Image_Sampler.from_string('16,16,AAAAAAAAAAAAAA4AEQDx/xGgDqAAAAAAAAAAAAAAAAA=');
console.log(sampler);
const s = 0.2;
const s = 0.08;
for (let y = -10; y < 10; y++) {
const xo = y & 1 ? s * .5 : 0;
const sxo = 0;
@@ -70,7 +68,6 @@ for (let y = -10; y < 10; y++) {
// Triangle lines
C.strokeStyle = '#000';
C.lineWidth = 1 / scale;
// Outline parallelogram
C.beginPath();