[object Object]

← back to Quadrille Showroom

Fix center-book leaf orientation: leaves face the viewer (drop the PI group flip)

f1439eaae3681cd7088c3c48a4833bd4a499f324 · 2026-06-29 15:16:21 -0700 · Steve

The PI group rotation pointed each leaf's textured +Z front AWAY from the spawn and put
the right leaf on the -x side. Removed it -- the plane's +Z front already faces the +Z
viewer -- and splayed each leaf's OUTER edge back so the book opens as a gentle V toward
the avatar. Verified: both leaves normalZ ~+0.95, R worldX +0.36 / repeat.x +1, L worldX
-0.36 / repeat.x -1 (true horizontal mirror).

Files touched

Diff

commit f1439eaae3681cd7088c3c48a4833bd4a499f324
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jun 29 15:16:21 2026 -0700

    Fix center-book leaf orientation: leaves face the viewer (drop the PI group flip)
    
    The PI group rotation pointed each leaf's textured +Z front AWAY from the spawn and put
    the right leaf on the -x side. Removed it -- the plane's +Z front already faces the +Z
    viewer -- and splayed each leaf's OUTER edge back so the book opens as a gentle V toward
    the avatar. Verified: both leaves normalZ ~+0.95, R worldX +0.36 / repeat.x +1, L worldX
    -0.36 / repeat.x -1 (true horizontal mirror).
---
 public/js/showroom.js | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/public/js/showroom.js b/public/js/showroom.js
index d646d0f..ac6da56 100644
--- a/public/js/showroom.js
+++ b/public/js/showroom.js
@@ -2021,22 +2021,26 @@ function buildCenterBook() {
 
   const group = new THREE.Group();
   group.position.set(0, 0, BOOK_SPINE_Z);  // hinge/spine on the room centre-line, ahead of the viewer
-  group.rotation.y = Math.PI;              // face the leaves back toward the +Z spawn (viewer at z=0)
+  // NO group flip: a PlaneGeometry's textured front (+Z normal) already faces the +Z spawn
+  // (viewer at z=0 looking -Z), so the leaves present their pattern straight at the avatar.
 
   const faceGeo = new THREE.PlaneGeometry(leafW, H);
 
-  // RIGHT leaf — hinged at the spine (local x=0), extends to +x, splayed toward the viewer.
+  // RIGHT leaf — hinged at the spine (local x=0), face centred at +x. A small +y rotation
+  // swings its OUTER (+x) edge slightly back (-Z) so the book opens toward the viewer as a
+  // gentle V; the +Z textured front still faces the spawn.
   const leafR = new THREE.Group();
-  leafR.rotation.y = -BOOK_LEAF_SPLAY;
-  const faceR = new THREE.Mesh(faceGeo, MAT.wall.clone ? new THREE.MeshStandardMaterial({ color: 0xece4d2, roughness: 0.7 }) : MAT.wall);
+  leafR.rotation.y = BOOK_LEAF_SPLAY;
+  const faceR = new THREE.Mesh(faceGeo, new THREE.MeshStandardMaterial({ color: 0xece4d2, roughness: 0.7 }));
   faceR.position.set(leafW / 2, yC, 0);
   faceR.receiveShadow = true; faceR.castShadow = true;
   faceR.userData = { isWingFace: true, parentPivot: centerBookPivotProxy(), leaf: 'R' };
   leafR.add(faceR);
 
-  // LEFT leaf — mirror twin: hinged at the spine, extends to -x, splayed toward the viewer.
+  // LEFT leaf — mirror twin: face centred at -x, splayed by -y so its outer (-x) edge swings
+  // back symmetrically. Its texture is horizontally mirrored (set in setCenterBook).
   const leafL = new THREE.Group();
-  leafL.rotation.y = BOOK_LEAF_SPLAY;
+  leafL.rotation.y = -BOOK_LEAF_SPLAY;
   const faceL = new THREE.Mesh(faceGeo.clone(), new THREE.MeshStandardMaterial({ color: 0xece4d2, roughness: 0.7 }));
   faceL.position.set(-leafW / 2, yC, 0);
   faceL.receiveShadow = true; faceL.castShadow = true;

← fa8ee90 Default view = walk the avatar + single centered mirrored bo  ·  back to Quadrille Showroom  ·  auto-save: 2026-06-29T15:24:16 (3 files) — public/js/showroo 6145090 →