Grid to editor

This commit is contained in:
2026-07-01 20:51:46 -05:00
parent 0b21388844
commit 503a3c799a
3 changed files with 52 additions and 2 deletions
+5
View File
@@ -221,6 +221,7 @@ const MapRenderer = (() => {
// scene = {
// target: [x, y, z], worldH: number,
// terrain: { mesh, texture } | null,
// gridLines: { mesh } | null,
// models: [{ mesh, texture, color: [r,g,b,a in 0..1], offset: [x,y,z] }],
// neighbors: [{
// offset: [x,y,z],
@@ -248,6 +249,10 @@ const MapRenderer = (() => {
drawMesh(scene.terrain.mesh, identity, scene.terrain.texture, [1, 1, 1, 1], true);
}
if(scene.gridLines) {
drawMesh(scene.gridLines.mesh, identity, null, [0, 0, 0, 0.35], false, gl.LINES);
}
for(const model of scene.models) {
const modelMatrix = mat4Translation(new Float32Array(16), model.offset);
drawMesh(model.mesh, modelMatrix, model.texture, model.color, true);