Skip to content

Skysphere fixes - #102

Merged
jsantell merged 1 commit into
masterfrom
skysphere
Nov 9, 2018
Merged

jsantell merged 1 commit into
masterfrom
skysphere

Conversation

@jsantell

@jsantell jsantell commented Nov 9, 2018

Copy link
Copy Markdown
Contributor

Attach the skysphere to the camera, and properly size the skysphere according to the largest size (with padding), rather than the reduced Z-depth. Fixes #82

screenshot from 2018-11-08 19-42-47

@jsantell
jsantell requested a review from cdata November 9, 2018 03:52
[$tick](time, delta) {
super[$tick](time, delta);
const camera = this[$scene].getCamera();
this[$scene].skysphere.position.copy(camera.position);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Related: #100

Comment thread src/utils.js Outdated

export const assert = (value, message) => {
if (!value) {
throw new Error(message || 'Assertion failed');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not make 'Assertion failed' the default value of the parameter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

Comment thread src/three-components/ModelScene.js Outdated
this.skysphere.scale.setScalar(longestWall * Math.sqrt(3));
assert(
skysphereSize < this.camera.far,
'Skysphere must be less than far plane.');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this actionable information for <model-viewer> users? In other words: does this fail because of something they did wrong or something we did wrong?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this case, something we did wrong -- can move it into a test? But if this happens in the wild we could have something to go off of

…ccording to the largest size (with padding), rather than the reduced Z-depth. Fixes #82
@cdata

cdata commented Nov 9, 2018

Copy link
Copy Markdown
Contributor

LGTM 👍

@jsantell
jsantell merged commit e204b5f into master Nov 9, 2018
@elalish
elalish deleted the skysphere branch February 3, 2020 18:23
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

Successfully merging this pull request may close these issues.

2 participants