1
나는 빨간색면이 카메라를 향하고 파란색면이 먼면이있는 색의 큐브라고하는 장면이 있습니다. "End"키를 클릭하고 카메라가 파란색면을 향하도록합니다 (카메라를 큐브가 아닌 곳으로 이동). 또한 "홈"키를 눌러 위와 반대로 할 수있는 옵션이 있으므로 빨간색으로 다시 이동합니다. 최고의 1 카메라 또는 나는 다음과 같은 코드로 인식 열쇠를 얻는 데 문제가 2Three.js 카메라 또는 다른 두 대의 카메라 이동
두 번째 것은 무엇
우선.
function animate()
{
requestAnimationFrame(animate);
render();
update();
}
function update()
{
if (keyboard.pressed("1"))
{ currentCamera = 1; }
if (keyboard.pressed("2"))
{ currentCamera=2; }
}
function render()
{
if(currentCamera==1) renderer.render(scene, camera1);
if(currentCamera==2) renderer.render(scene, camera2);
}
내 문제가 수정되었습니다. 이제 카메라보기도 전환됩니다. – Phil