Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
50f22e82
Commit
50f22e82
authored
Apr 29, 2013
by
Robert Menzel
Browse files
fixed setting of vertical FoV
parent
d505364a
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ACGL/Scene/GenericCamera.hh
View file @
50f22e82
...
...
@@ -148,7 +148,7 @@ class GenericCamera
/**
* Set the vertical field of view of the camera in degree.
*
Aspect ratio
will get changed!
*
Horizontal FoV
will get changed!
* @param _fovv New vertical field of view of the camera.
*/
void
setVerticalFieldOfView
(
float
_fovv
);
...
...
src/ACGL/Scene/GenericCamera.cc
View file @
50f22e82
...
...
@@ -163,7 +163,10 @@ void GenericCamera::setVerticalFieldOfView(float _fovv)
// we only save the aspectRatio and the horizontal FoV
// so if we change the vertical FoV, we change the aspectRatio
mAspectRatio
=
tan
(
calcDegToRad
(
0.5
f
*
mHorizontalFieldOfView
)
)
/
tan
(
calcDegToRad
(
0.5
f
*
_fovv
)
);
//mAspectRatio = tan( calcDegToRad(0.5f * mHorizontalFieldOfView) ) / tan( calcDegToRad(0.5f * _fovv) );
float
x
=
tan
(
calcDegToRad
(
0.5
f
*
_fovv
)
)
*
mAspectRatio
;
mHorizontalFieldOfView
=
calcRadToDeg
(
2.0
f
*
atan
(
x
)
);
}
float
GenericCamera
::
getVerticalFieldOfView
()
const
...
...
@@ -215,7 +218,7 @@ glm::mat4 GenericCamera::getStereoViewMatrix( bool _leftEye, StereoMode _stereoM
// just shift the camera position to the left/right by half the eye-distance
//
ACGL
::
Utils
::
debug
()
<<
"WARNING: getStereoViewMatrix() is not tested yet"
<<
std
::
endl
;
// remove after testing
//
ACGL::Utils::debug() << "WARNING: getStereoViewMatrix() is not tested yet" << std::endl; // remove after testing
glm
::
mat3
inverseRotation
=
getInverseRotationMatrix3
();
glm
::
vec3
eyePosition
=
mPosition
+
(
inverseRotation
*
glm
::
vec3
(
cameraPositionShiftValue
,
0.0
f
,
0.0
f
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment