-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update orthographic projection width #5108
Conversation
if (defined(rayIntersection)) { | ||
|
||
if (scene.pickPositionSupported) { | ||
depthIntersection = scene.pickPositionWorldCoordinates(mousePosition, scratchDepthIntersection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, are there other areas that commonly call pickPosition
? Caching based on the window coordinates per-frame might not be a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. We could even take it further and cache it for a few frames or more depending on the frame rate, but that's not something I want to explore here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll open an issue so we can think about it more.
Source/Scene/Camera.js
Outdated
if (defined(rayIntersection) && defined(depthIntersection)) { | ||
var depthDistance = defined(depthIntersection) ? Cartesian3.distance(depthIntersection, this.positionWC) : Number.POSITIVE_INFINITY; | ||
var rayDistance = defined(rayIntersection) ? Cartesian3.distance(rayIntersection, this.positionWC) : Number.POSITIVE_INFINITY; | ||
this.frustum.width = depthDistance < rayDistance ? depthDistance : rayDistance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Math.min?
@lilleyse This is ready. |
Update frustum width by picking the depth buffer. Previously, the width was set by the distance to the globe. This would cause clipping large building models.