Commit 3b0e9cda authored by Ellen Dekkers's avatar Ellen Dekkers

Budfix in ortho2DMode: set gluLookat to correctly handle the z-axis

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10436 383ad7c9-94d9-4d36-a494-682f7c89f535
parent eaeb8f5e
......@@ -334,6 +334,9 @@ TransformNode::
ortho2DMode(GLState& _state)
{
// return;
// double currentNear = _state.near_plane();
// double currentFar = _state.far_plane();
// std::cout << "currentNear =" << currentNear << ", currentFar = " << currentFar << std::endl;
// set ortho 2D mode in glstate
int width = _state.viewport_width();
......@@ -344,18 +347,20 @@ ortho2DMode(GLState& _state)
// _state.viewport(0,0,width, height);
_state.reset_projection();
_state.ortho(0.0, (GLdouble)width, (GLdouble)height, 0.0, -1000.0, 1000.0);
// _state.ortho(0.0, (GLdouble)width, (GLdouble)height, 0.0, -1.0, 1.0);
// _state.ortho(0.0, (GLdouble)width, 0.0, (GLdouble)height, -1.0, 1.0);
_state.ortho(-(GLdouble)width/2.0, (GLdouble)width/2.0, -(GLdouble)height/2.0, (GLdouble)height/2.0, 0.01, 20.0);
// _state.ortho(0.0, (GLdouble)width, (GLdouble)height, 0.0, 0.01,20.0);
_state.reset_modelview();
// move image center to window center
_state.translate( 0.5*(width-1), 0.5*(height-1), 0);
_state.lookAt( Vec3d(0.0,0.0,0.0),
Vec3d(0.0,0.0,1.0),
Vec3d(0.0,-1.0,0.0)); // flip up direction (y-axis) s.t. opengl coordsys matches image coordsys
// _state.translate( 0.5*(width-1), 0.5*(height-1), 0);
_state.scale(scaleFactor2D_, scaleFactor2D_, 1.0);
// move image center to window center
if (imageDimensions_[0] != -1)
_state.translate(-0.5*(imageDimensions_[0]-1), -0.5*(imageDimensions_[1]-1), 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment