창 오른쪽과 왼쪽에 두 개의 개체가 있습니다. 두 개의 오브젝트로 두 개의 PerspectiveCamera로 개별적으로 확대/축소하는 방법은 무엇입니까?
내가 가리킬 때 해당 개체를 개별적으로 확대하고 싶습니다.
var itsLeftControls, itsRightControls;
itsRightControls = new THREE.TrackballControls(itsRightCamera);
itsLeftControls = new THREE.TrackballControls(itsLeftCamera);
document.getElementById('SubContainerLeft').onmouseover = function() {
aMouseOverActivate(itsLeftControls);
aMouseOverDeactivate(itsRightControls);
};
document.getElementById('SubContainerRight').onmouseover = function() {
aMouseOverActivate(itsRightControls);
aMouseOverDeactivate(itsLeftControls);
};
function aMouseOverActivate(theControl)
{
theControl.zoomSpeed = 0.8;
}
function aMouseOverDeactivate(theControl)
{
theControl.zoomSpeed = 0.0;
}
function animateLeft()
{
requestAnimationFrame(animateLeft);
renderLeft();
}
function renderLeft()
{
itsLeftControls.update();
itsLeftRenderer.render(itsLeftScene, itsLeftCamera);
}
function animateRight()
{
requestAnimationFrame(animateRight);
renderRight();
}
function renderRight()
{
itsRightControls.update();
itsRightRenderer.render(itsRightScene, itsRightCamera);
}
마우스를 왼쪽으로 가져 가서 마우스 스크롤 휠로 확대하려고하면 잘 작동합니다. 그런 다음 마우스를 오른쪽으로 가져 가면 마우스를 스크롤하지 않고도 오른쪽에서 동일한 확대/축소 효과를 볼 수 있습니다. 해결 방법?
컨트롤 코드 – 2pha
여기에서 TrackballControls를 사용하고 있습니다. 우선, 왼쪽 및 오른쪽 컨트롤을 설정합니다. ZoomSpeed는 0이며 각면을 가리키면서이 함수를 호출합니다. – Mhd
@ 2pha - 왼쪽을 확대하고 오른쪽으로갔습니다. 그래서, 오른쪽 객체는 왼쪽 사이드처럼 똑같이 확대되었습니다 :(마우스 휠을 스크롤 할 때만 양쪽 객체가 작동합니다.) – Mhd