mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
SurfaceCtrl: fixed ortho camera
git-svn-id: svn://ultimatepp.org/upp/trunk@14787 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fbfaf2149d
commit
21d4bd7b1d
1 changed files with 2 additions and 1 deletions
|
|
@ -28,8 +28,9 @@ class SketchupCamera : public UOGL_Camera {
|
|||
return glm::perspective(glm::radians(GetFOV()),(float)( ScreenSize.cx / ScreenSize.cy),GetDrawDistanceMin(),GetDrawDisanceMax());//We calculate Projection here since multiple camera can have different FOV
|
||||
}else if(type == CT_ORTHOGRAPHIC){
|
||||
float distance = glm::distance(focus,transform.GetPosition())* (ScreenSize.cx/ScreenSize.cy);
|
||||
float distanceY = glm::distance(focus,transform.GetPosition())* (ScreenSize.cy/ScreenSize.cx);
|
||||
float distanceY = glm::distance(focus,transform.GetPosition());
|
||||
return glm::ortho(-distance ,distance ,-distanceY ,distanceY, 0.00001f, 10000.0f);
|
||||
// return glm::ortho(-glm::distance(focus,transform.GetPosition()) ,glm::distance(focus,transform.GetPosition()) ,-glm::distance(focus,transform.GetPosition()) ,glm::distance(focus,transform.GetPosition()), 0.00001f, 10000.0f);
|
||||
}else{
|
||||
LOG("Swaping to Camera Perspective (cause of unknow type)");
|
||||
return glm::perspective(glm::radians(GetFOV()),(float)( ScreenSize.cx / ScreenSize.cy),GetDrawDistanceMin(),GetDrawDisanceMax());//We calculate Projection here since multiple camera can have different FOV
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue