Skip to content
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
4 changes: 3 additions & 1 deletion example/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,14 @@ async function init() {
const maxDim = Math.max( size.x, size.y, size.z );
const fov = camera.fov * ( Math.PI / 180 );
const distance = maxDim / ( 2 * Math.tan( fov / 2 ) ) * 1.5;
camera.position.set( 0, 0, distance );

camera.near = maxDim / 100;
camera.far = maxDim * 10;
camera.updateProjectionMatrix();

// Reset camera and controls
camera.position.set( 0, 0, distance );
camera.lookAt( 0, 0, 0 );
Comment on lines +166 to +168
Copy link
Owner

Choose a reason for hiding this comment

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

How does this fix it? The position is set to the same value and "lookAt" is called in controls.update so isn't this the same thing as before?

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 test later today. Maybe I was using an old bundle or something. This whole parcel/vite process for updating examples confuses me.

controls.target.set( 0, 0, 0 );
controls.update();

Expand Down
Loading