Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should naming be exchanged? #1227

Open
dansirming opened this issue Apr 30, 2023 · 1 comment
Open

Should naming be exchanged? #1227

dansirming opened this issue Apr 30, 2023 · 1 comment

Comments

@dansirming
Copy link

the code as follow:

 void CameraManipulator::computeHomePosition(const osg::Camera *camera, bool useBoundingBox)
{
      ..........
      if (camera->getProjectionMatrixAsFrustum(left,right,bottom,top,zNear,zFar))
            {
                **double vertical2 = fabs(right - left) / zNear / 2.;
                double horizontal2 = fabs(top - bottom) / zNear / 2.;**
               ...........
            }
            ..........
}

I think the code of bold should be as follow:

double horizontal2 = fabs(right - left) / zNear / 2.;
double  vertical2 = fabs(top - bottom) / zNear / 2.;

Names should be exchanged to avoid misunderstandings!Is it because I misunderstood this code?

@robertosfield
Copy link
Collaborator

Well spotted, it looks like this typo has been sitting there in the code quite some while. For future reference the problem code is:

https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgGA/CameraManipulator.cpp#l107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants