개발/VR

Three.js + WebVR Example Docs

yunzema 2018. 11. 28. 15:01
반응형

1) Example/WebVR.js의 사용



2) document.body.appendChild( WEBVR.createButton( renderer ) );

=> VR 연동하여 VR세션 초기화 하는 버튼 생성


3) renderer.vr.enabled = true;

=> WebGLRenderer의 VR Rendering 속성을 설정


4) renderer.setAnimationLoop( function () {

renderer.render( scene, camera );    } );


=> 기존 requestAnimationFrame()함수를 사용하지 못하므로 VR프로젝트에선 animation loop를 사용하여 랜더링 함.



참고 링크 : https://threejs.org/docs/#manual/en/introduction/How-to-create-VR-content



**현재 공식으로 사용할 수 있는 기능이 아니므로 origin trial 토큰이 필요**

**그리고 현재 WebVR은 개발 중단 WebXR로 편승됨. 다음 글 참조**