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

autoclipping nearlimit is ignored for orthographic cameras #76

Open
foobarbecue opened this issue Dec 7, 2023 · 0 comments
Open

autoclipping nearlimit is ignored for orthographic cameras #76

foobarbecue opened this issue Dec 7, 2023 · 0 comments
Labels
acknowledged Coin3d team acknowledges this issue

Comments

@foobarbecue
Copy link

When you set autoclipping with an strategy like

mySoQtViewer->setAutoClippingStrategy(SoQtViewer::CONSTANT_NEAR_PLANE, 0.7)

0.7 defines the minimum near plane distance. This works well for perspective camera, but for orthographic cameras it is totally ignored. In situations where the orthographic camera is moved into the scene bounding box, the near clip value becomes negative, and objects behind the camera remain visible as the camera moves pasat them.

I'm not sure why the code was written this way, but it's clear that this->autoclipvalue is only referenced when camera isOfType SoPerspectiveCamera here:

https://github.com/coin3d/sogui/blob/243e78abedaa88a22babc3357e9dfca1b75a2a95/viewers/SoGuiViewer.cpp.in#L860-L898

It's also notable that the code handles the "all objects behind camera" case for perspective cameras but not orthographic cameras.

It's almost like someone felt that orthographic cameras should be able to see behind them? Is there any reason for that?

I might be interested in submitting a PR to fix this if there is agreement.

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

No branches or pull requests

2 participants