여기 내 문제입니다, 나는 마우스 포인터가 돌출 된 스케일 포인트가 있습니다. . 또한카메라를 번역하면서 마우스를 확대하고 있습니까? (OpenGL)
I'v이 시도 기본적으로 마우스 위치로 확대 달성되어 내가 원하는 무엇 X와 Y에 의해 모든 개체를 변환하는 "카메라를 가지고 :
1. Find the mouse's x and y coordinates
2. Translate by (x,y,0) to put the origin at those coordinates
3. Scale by your desired vector (i,j,k)
4. Translate by (-x,-y,0) to put the origin back at the top left
을하지만이되지 않습니다 대신 모든 개체를 이동 glTranslate를 사용하는 카메라의 번역 요인. 내가 제대로이 작업을 수행 할 수있는 방법
. 감사합니다
glTranslatef(controls.MainGlFrame.GetCameraX(),
controls.MainGlFrame.GetCameraY(),0);
glTranslatef(current.ScalePoint.x,current.ScalePoint.y,0);
glScalef(current.ScaleFactor,current.ScaleFactor,0);
glTranslatef(-current.ScalePoint.x,-current.ScalePoint.y,0);
(I, J, K : 당신이 포인트를 확대 할 때
지금, 당신은 단순히 같은 것을 할 필요가) 당신이 넣을 때 z 축을 확대하려고 시도 했습니까? –
자세한 정보 및 명확성이 필요합니다. 아마 소스 코드? "2. Translate by ..."는 프로젝션 뷰 매트릭스 변환을 의미합니까? 어떤 방식으로 이것은 "카메라 번역의 요소"가 아닙니까? 이것은 2D 정사영 뷰입니다. 맞습니까? – Detmar
그 작업이 없습니다 – jmasterx