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

Camera clipping terrain fix #3750

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Source/Scene/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ define([
viewMatrix[15] = 1.0;

Matrix4.multiply(viewMatrix, camera._actualInvTransform, camera._viewMatrix);
Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);

// Camera vectors may not be orthonormal when the camera clamps to the terrain
// so apply inverse instead of inverseTransformation
Matrix4.inverse(camera._viewMatrix, camera._invViewMatrix);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just a band-aid? Should we apply Gram–Schmidt orthonormalization earlier so the matrix is orthonormal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes just a band-aid right now. I'll try to fix the main problem before this is ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine the shadows branch, but are you sure you want to put this in master now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lilleyse what do you think? Should we close this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll close this and submit an issue instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or.. just keep the fog issue open.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave the fog issue open.

}

var scratchCartographic = new Cartographic();
Expand Down