relative rendering, but maybe still a bug with proportions?
This commit is contained in:
+5
-13
@@ -5,7 +5,7 @@ const socket = io("http://localhost:3000");
|
||||
|
||||
const params = {
|
||||
fps: 60,
|
||||
zoom: 0.01,
|
||||
zoom: 0.1,
|
||||
backgroundTicks: 60,
|
||||
textSpread: 0,
|
||||
maxSpawns: 1,
|
||||
@@ -188,12 +188,8 @@ const sketch = (p) => {
|
||||
p.background(0);
|
||||
|
||||
p.shader(shaderProgram);
|
||||
// p.ortho(x, x + width, y + height, y);
|
||||
// p.ortho(0, -p.windowWidth, -p.windowHeight, 0);
|
||||
console.log(
|
||||
`ortho: ${-p.width / 2}, ${p.width / 2}, ${-p.height / 2}, ${p.height / 2}`,
|
||||
);
|
||||
p.ortho(0, p.width, -p.height, 0);
|
||||
// p.ortho(0, p.width, -p.height, 0);
|
||||
p.ortho(x, x + width, -y - height, -y);
|
||||
|
||||
// Bind texture array
|
||||
gl.activeTexture(gl.TEXTURE0);
|
||||
@@ -213,12 +209,8 @@ const sketch = (p) => {
|
||||
// Tell shader which layer to sample
|
||||
shaderProgram.setUniform("uLayer", currentLayer);
|
||||
|
||||
// Draw a quad covering the screen
|
||||
console.log(
|
||||
`Drawing tile ${currentLayer} at ${col * tileW}, ${row * tileH}`,
|
||||
);
|
||||
// p.rect(col * tileW, row * tileH, tileW, tileH);
|
||||
p.rect(0, 0, tileW, tileH);
|
||||
p.rect(col * tileW, row * tileH, tileW, tileH);
|
||||
// p.rect(0, 0, tileW, tileH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user