Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/openFrameworks/3d/ofEasyCam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ void ofEasyCam::updateTranslation(){
if(getOrtho()){
//In ortho mode moving along the z axis has no effect besides clipping.
// Instead, scale is applied to achieve the effect of getting near or far from the target.
glm::vec3 mousePre ;
glm::vec3 mousePre;
bool bDoScale = (currentTransformType == TRANSFORM_SCALE || currentTransformType == TRANSFORM_TRANSLATE_Z);
if (bDoScale) {
mousePre = screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0));
mousePre = screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0), viewport);
}
move(glm::vec3(lastPressAxisX * translate.x) + (lastPressAxisY * translate.y));
if (bDoScale) {
setScale(getScale() + translate.z);
// this move call is to keep the scaling centered below the mouse.
move(mousePre - screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0)));
move(mousePre - screenToWorld(glm::vec3((bIsScrolling?mouseAtScroll:lastPressMouse),0), viewport));
}
}else{
move(glm::vec3(lastPressAxisX * translate.x) + (lastPressAxisY * translate.y) + (lastPressAxisZ * translate.z));
Expand Down