fix: adjust storefront door coordinates and pivot variables to align door swing perfectly with the new high-res facade texture
This commit is contained in:
parent
613499648f
commit
857a840059
@ -27,7 +27,7 @@ const facadeFragmentShader = `
|
||||
void main() {
|
||||
vec4 col = texture2D(uTexture, vUv);
|
||||
// Discard double doors in center of storefront
|
||||
if (vUv.x >= 0.468 && vUv.x <= 0.532 && vUv.y >= 0.15 && vUv.y <= 0.50) {
|
||||
if (vUv.x >= 0.46 && vUv.x <= 0.54 && vUv.y >= 0.10 && vUv.y <= 0.52) {
|
||||
discard;
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, col.a * uOpacity);
|
||||
@ -40,7 +40,7 @@ const leftDoorFragmentShader = `
|
||||
varying vec2 vUv;
|
||||
void main() {
|
||||
// Crop texture to left door leaf boundaries
|
||||
vec2 uv = vec2(0.468 + vUv.x * 0.032, 0.15 + vUv.y * 0.35);
|
||||
vec2 uv = vec2(0.46 + vUv.x * 0.04, 0.10 + vUv.y * 0.42);
|
||||
vec4 col = texture2D(uTexture, uv);
|
||||
gl_FragColor = vec4(col.rgb, col.a * uOpacity);
|
||||
}
|
||||
@ -52,7 +52,7 @@ const rightDoorFragmentShader = `
|
||||
varying vec2 vUv;
|
||||
void main() {
|
||||
// Crop texture to right door leaf boundaries
|
||||
vec2 uv = vec2(0.50 + vUv.x * 0.032, 0.15 + vUv.y * 0.35);
|
||||
vec2 uv = vec2(0.50 + vUv.x * 0.04, 0.10 + vUv.y * 0.42);
|
||||
vec4 col = texture2D(uTexture, uv);
|
||||
gl_FragColor = vec4(col.rgb, col.a * uOpacity);
|
||||
}
|
||||
@ -92,11 +92,11 @@ function CinematicFlight({ progress }: { progress: number }) {
|
||||
const planeW = planeH * aspect;
|
||||
|
||||
// Door dimensions matching facade coordinate percentages
|
||||
const dw = 0.032 * planeW;
|
||||
const dh = 0.35 * planeH;
|
||||
const doorY = -0.175 * planeH;
|
||||
const leftHingeX = -0.032 * planeW;
|
||||
const rightHingeX = 0.032 * planeW;
|
||||
const dw = 0.04 * planeW;
|
||||
const dh = 0.42 * planeH;
|
||||
const doorY = -0.19 * planeH;
|
||||
const leftHingeX = -0.04 * planeW;
|
||||
const rightHingeX = 0.04 * planeW;
|
||||
|
||||
const extGroupRef = useRef<THREE.Group>(null);
|
||||
const intMeshRef = useRef<THREE.Mesh>(null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user