Skip to content
Open

Main #38

Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
62ae46d
Merge pull request #13 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
01aad5c
Merge pull request #15 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
eb8d3a6
Merge pull request #17 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
61da93c
Merge pull request #19 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
73b337b
Merge pull request #21 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
f489ac6
Merge pull request #23 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 24, 2025
5c823b3
Merge pull request #27 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
ba5a8c7
Merge pull request #29 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
4cfb8e6
Merge pull request #31 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
f947797
Merge pull request #33 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
f857ae2
Merge pull request #37 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
5a931d2
Merge pull request #40 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
10a88b5
Merge pull request #42 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
6629e15
Merge pull request #44 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
0f1ac85
Merge pull request #46 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
11008d2
Merge pull request #48 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
1d5f4b2
Merge pull request #51 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
8a63d92
Merge pull request #54 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
03fafc1
Merge pull request #56 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
7c77e45
Merge pull request #59 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
f676ef0
Merge pull request #63 from problem-not-found/develop
psyyyyyyyyyyyyyy Aug 25, 2025
d0f8377
Merge pull request #65 from problem-not-found/develop
wnsgur393 Aug 25, 2025
f27bc5b
Merge pull request #67 from problem-not-found/develop
wnsgur393 Aug 25, 2025
487bde4
Merge pull request #69 from problem-not-found/develop
wnsgur393 Aug 25, 2025
1305261
Merge pull request #71 from problem-not-found/develop
wnsgur393 Aug 25, 2025
114856c
Merge pull request #73 from problem-not-found/develop
wnsgur393 Aug 25, 2025
202940d
Merge pull request #75 from problem-not-found/develop
wnsgur393 Aug 25, 2025
ca4bfaa
update code
wnsgur393 Aug 25, 2025
c35e217
Merge pull request #76 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
2b9e8f4
z
wnsgur393 Aug 25, 2025
5e291d8
z
wnsgur393 Aug 25, 2025
d5cd3c0
Merge pull request #77 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
94e9375
z
wnsgur393 Aug 25, 2025
d712239
Merge pull request #78 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
235d325
asdf
wnsgur393 Aug 25, 2025
d30b2c5
Merge pull request #79 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
9dd664c
z
wnsgur393 Aug 25, 2025
6bbaeb0
Merge pull request #80 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
bf1924d
z
wnsgur393 Aug 25, 2025
adbf106
Merge pull request #81 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
9572296
ㅁㄴㅇ
wnsgur393 Aug 25, 2025
1042a39
Merge pull request #82 from problem-not-found/reallastbranch
wnsgur393 Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 49 additions & 69 deletions src/components/ArtworkFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,78 +26,58 @@ function SafeImagePlane({
}

console.log("이미지 로딩 시작:", imageUrl);
const loader = new TextureLoader();


// HTML Image 객체를 사용하여 백엔드 프록시를 통해 이미지 로드
const img = new Image();
img.crossOrigin = "anonymous";

img.onload = () => {
console.log("✅ HTML Image 로드 성공, TextureLoader로 변환 중...");
loader.load(
imageUrl, // 프록시 URL 사용
(loadedTexture) => {
console.log("✅ 이미지 로딩 성공:", imageUrl);
console.log("텍스처 정보:", loadedTexture);
loadedTexture.flipY = true; // 이미지 뒤집힘 문제 해결
setTexture(loadedTexture);
setLoading(false);
},
(progress) => {
console.log("📥 이미지 로딩 진행:", imageUrl, progress);
},
(err) => {
console.error("❌ 이미지 로드 실패:", imageUrl);
console.error("에러 상세:", err);
console.error("에러 타입:", typeof err);
console.error("에러 메시지:", err?.message);

// 원본 URL로 직접 시도해보기
if (imageUrl.startsWith("/s3-proxy/")) {
const originalUrl = `https://likelion13-artium.s3.ap-northeast-2.amazonaws.com${imageUrl.replace(
"/s3-proxy",
""
)}`;
console.log("🔄 원본 URL로 재시도:", originalUrl);

// HTML Image를 Three.js TextureLoader로 변환
const loader = new TextureLoader();
const texture = loader.load(
`https://api.artium.life/api/piece?filename=${encodeURIComponent(imageUrl)}`, // 백엔드 프록시 URL
undefined,
undefined,
(err) => {
console.error("❌ TextureLoader 로드 실패", err);
const retryLoader = new TextureLoader();
retryLoader.setCrossOrigin("anonymous");
retryLoader.load(
originalUrl,
(loadedTexture) => {
console.log("✅ 원본 URL로 로딩 성공:", originalUrl);
loadedTexture.flipY = true;
setTexture(loadedTexture);
setLoading(false);
},
undefined,
(retryErr) => {
console.error("❌ 원본 URL로도 실패:", retryErr);
setError(true);
setLoading(false);
}
);
} else {
setError(true);
setLoading(false);
}
);

// 이미지 뒤집기 설정
texture.flipY = true;

setTexture(texture);
setLoading(false);
console.log("🎨 Three.js 텍스처 변환 완료!");
};

img.onerror = (err) => {
console.error("❌ HTML Image 로드 실패:", imageUrl);
console.error("에러 상세:", err);

// 백엔드 프록시 URL로 재시도
const proxyUrl = `https://api.artium.life/api/piece?filename=${encodeURIComponent(imageUrl)}`;
console.log("🔄 백엔드 프록시 URL로 재시도:", proxyUrl);

const retryImg = new Image();
retryImg.crossOrigin = "anonymous";

retryImg.onload = () => {
console.log("✅ 백엔드 프록시로 로딩 성공:", proxyUrl);

const retryLoader = new TextureLoader();
const retryTexture = retryLoader.load(
proxyUrl,
undefined,
undefined,
(retryErr) => {
console.error("❌ 백엔드 프록시로도 실패:", retryErr);
setError(true);
setLoading(false);
}
);

retryTexture.flipY = true;
setTexture(retryTexture);
setLoading(false);
};

retryImg.onerror = (retryErr) => {
console.error("❌ 백엔드 프록시로도 실패:", retryErr);
setError(true);
setLoading(false);
};

retryImg.src = proxyUrl;
};

// 백엔드 프록시 URL로 이미지 로드 시작
const proxyUrl = `https://api.artium.life/api/piece?filename=${encodeURIComponent(imageUrl)}`;
img.src = proxyUrl;
}
);
}, [imageUrl]);

if (loading) {
Expand Down Expand Up @@ -168,9 +148,9 @@ function ArtworkFrame({ artwork, position, onArtworkClick }) {
else if (x > 16) {
return [0, -Math.PI / 2, 0]; // -90도 회전
}
// 앞쪽 벽 (z > 7)
// 앞쪽 벽 (z > 7) - 카메라를 향하도록
else if (z > 7) {
return [0, Math.PI, 0]; // 180도 회전
return [0, 0, 0]; // 회전 없음 (카메라를 향함)
}
// 뒷벽 (z < -7) 또는 기본
else {
Expand Down