From 1d30f3fc13384e65e7473aaa704fc914c1f3c5fd Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 14 Feb 2023 22:02:32 +0100 Subject: [PATCH] Steps toward improved textures in turtle --- scene/lobby.pr | 153 +++++++++++++++++++++++++------------------------ src/turtle.ts | 9 +-- 2 files changed, 82 insertions(+), 80 deletions(-) diff --git a/scene/lobby.pr b/scene/lobby.pr index 821d7d1..43bbdf2 100644 --- a/scene/lobby.pr +++ b/scene/lobby.pr @@ -38,91 +38,92 @@ - - >>> + interiorWall + Home + 2.1 F + [0.2 F [1 F] iDoor 6.5 F] draw + 1.1 B [90 L [0.2 F [1 F] iDoor 1 F] draw] saved + 1.4 B [ + ++ + [2.1 F ++ 1 F [0.6 F] iDoor 1.4 F] draw 3 B + 0.7 F -- [0.1 F [0.7 F] iDoor 0.1 F] draw + [[2.7 F ++ 0.6 F] draw] saved + ++ 3.2 B + [4.2 F -- 0.2 F [1 F] iDoor 1.5 F -- 0.4 F ++] draw + [0.1 F [0.7 F] iDoor 0.2 F] draw + [-- [3.8 F] draw] saved + [0.9 F [0.6 F] iDoor 3.0 F] draw + [-- [3.1 F] draw] saved + [0.2 F [0.7 F] iDoor 0.4 F] draw + [++ [1.7 F] draw] saved + [0.1 F [0.6 F] iDoor 0.2 F] draw + ] saved + 1.6 B [90 L [0.2 F [1 F] iDoor 1 F] draw] saved + 1.4 B [90 R [2.3 F [0.7 F] iDoor 6.2 F [0.9 F] iDoor 1 F] draw] saved + ]> + >>>> [] diff --git a/src/turtle.ts b/src/turtle.ts index 41d8d89..fc7a9a7 100644 --- a/src/turtle.ts +++ b/src/turtle.ts @@ -1,6 +1,5 @@ import { Mesh, - MeshBuilder, Plane, Quaternion, Ray, @@ -166,9 +165,11 @@ export class TurtleVM extends Cat.VM { function pushPoint(pathIndex: number, stepIndex: number): number { const pointIndex = positions.length / 3; - positions.push(... paths[pathIndex][stepIndex].asArray()); - uvs.push(us[pathIndex][stepIndex] / uTotal[pathIndex], - vs[stepIndex][pathIndex] / vTotal[stepIndex]); + const p = paths[pathIndex][stepIndex]; + positions.push(... p.asArray()); + uvs.push((p.x - p.z) / 1.2, (p.y) / 0.9); + // uvs.push(us[pathIndex][stepIndex] / uTotal[pathIndex], + // vs[stepIndex][pathIndex] / vTotal[stepIndex]); return pointIndex; }