Three.js: WebGL ๋ฏธ๋Ÿฌ ์˜ˆ์ œ ์•„ํ‹ฐํŒฉํŠธ

์— ๋งŒ๋“  2017๋…„ 08์›” 17์ผ  ยท  5์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: mrdoob/three.js

์นด๋ฉ”๋ผ๋ฅผ ํ™•๋Œ€ํ•˜๊ณ  ์•ฝ๊ฐ„ ์ด๋™ํ•˜๋ฉด ์ธ๊ณต๋ฌผ์ด ์žฌํ˜„ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

https://threejs.org/examples/webgl_mirror.html

screen shot 2017-08-16 at 8 53 26 pm

Three.js ๋ฒ„์ „
  • [x] ๊ฐœ๋ฐœ์ž
  • [x] r86
๋ธŒ๋ผ์šฐ์ €
  • [x] ํฌ๋กฌ
OS
  • [x] macOS

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

@mrdoob ์—ฌ์ „ํžˆ ์—‰๋ง์ด ๋œ ๊ฒฝ์šฐ ๋‹จ์ˆœํ™” ํ•  ์—ฌ์ง€๊ฐ€ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค ...

//mirrorCamera.up.set( 0, - 1, 0 );
//mirrorCamera.up.applyMatrix4( rotationMatrix );
//mirrorCamera.up.reflect( normal ).negate();

mirrorCamera.up.set( 0, 1, 0 ).applyMatrix4( rotationMatrix ).reflect( normal );

๋ชจ๋“  5 ๋Œ“๊ธ€

๊ณผ์—ฐ.
์ด ์ฃผ์ œ๋„ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค : https://github.com/mrdoob/three.js/issues/11885
๊ฒฐ๊ตญ ๋‚˜๋Š” Mirror๊ฐ€ ์ œ๋Œ€๋กœ ๊ตฌํ˜„๋˜์ง€ ์•Š์€ ๋Š๋‚Œ์„๋ฐ›์Šต๋‹ˆ๋‹ค.

๋ฉ”์ธ ์นด๋ฉ”๋ผ์˜ ํ™”๋ฉด ๋น„์œจ์€ ๋ฏธ๋Ÿฌ ์นด๋ฉ”๋ผ์— ๋ณต์‚ฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

// "examples/Mirror.js" (lines 142-146)
mirrorCamera.near = camera.near;
mirrorCamera.far = camera.far;
mirrorCamera.updateMatrixWorld();
mirrorCamera.updateProjectionMatrix();

๋‹ค์Œ์œผ๋กœ ๋ณ€๊ฒฝํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

mirrorCamera.updateMatrixWorld();
mirrorCamera.projectionMatrix.copy(camera.projectionMatrix);

๋‚˜์ค‘์— PR์„ ๋ณด๋‚ด๊ฒ ์Šต๋‹ˆ๋‹ค!

๊ฑฐ์šธ (๋ฐ ํ‰๋ฉด ๋ฐ”๋‹ค)์˜ ๋˜ ๋‹ค๋ฅธ ๋ฌธ์ œ๋Š” logarithmicDepthBuffer ๊ฐ€ ํ™œ์„ฑํ™”๋˜์—ˆ์„ ๋•Œ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ‰๋ฉด ํด๋ฆฌํ•‘์€ ๊นŠ์ด๊ฐ€ ์—‰๋ง์ด๋˜๊ณ  ์ด์— ๋Œ€ํ•œ ํ•ด๊ฒฐ์ฑ…์„ ์ฐพ์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค. WebGL์— glClipPlane ์žˆ์—ˆ์œผ๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ˜ž

@vanruesc ์ฝ”๋“œ๋ฅผ ์—‰๋ง์œผ๋กœ

@mrdoob ์—ฌ์ „ํžˆ ์—‰๋ง์ด ๋œ ๊ฒฝ์šฐ ๋‹จ์ˆœํ™” ํ•  ์—ฌ์ง€๊ฐ€ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค ...

//mirrorCamera.up.set( 0, - 1, 0 );
//mirrorCamera.up.applyMatrix4( rotationMatrix );
//mirrorCamera.up.reflect( normal ).negate();

mirrorCamera.up.set( 0, 1, 0 ).applyMatrix4( rotationMatrix ).reflect( normal );

@WestLangley ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰