Skip to content

fix(Renderer): improve comment clarity #3227

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 13 additions & 11 deletions Sources/Rendering/Core/Renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,19 @@

// default so that the bounding sphere fits within the view fustrum

// compute the distance from the intersection of the view frustum with the
// bounding sphere. Basically in 2D draw a circle representing the bounding
// sphere in 2D then draw a horizontal line going out from the center of
// the circle. That is the camera view. Then draw a line from the camera
// position to the point where it intersects the circle. (it will be tangent
// to the circle at this point, this is important, only go to the tangent
// point, do not draw all the way to the view plane). Then draw the radius
// from the tangent point to the center of the circle. You will note that
// this forms a right triangle with one side being the radius, another being
// the target distance for the camera, then just find the target dist using
// a sin.
// Viewing the scene from the side in 2D:
// Draw a circle representing the bounding sphere containing all pixels.

Check failure on line 416 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// Then, draw a horizontal line going out from the center of the circle.

Check failure on line 417 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// The camera is somewhere on this line.

Check failure on line 418 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// Picture the view frustrum, moving through the circle.
// Draw a line from the intersection of the view frustrum and the bounding sphere to line the camera is on, ensuring that the line is tangent to the circle.

Check failure on line 420 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// Draw the radius from the tangent point to the center of the circle.

Check failure on line 421 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// You will note that this forms a right triangle with sides:

Check failure on line 422 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// - radius

Check failure on line 423 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// - the line formed by the intersection of the view frustrum and the bounding sphere
// - the target distance for the camera.

Check failure on line 425 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`
// We can use trigonometry to solve for that distance.

Check failure on line 426 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `·`

Check failure on line 427 in Sources/Rendering/Core/Renderer/index.js

View workflow job for this annotation

GitHub Actions / ubuntu-24.04 and node 22

Delete `····`
const angle = vtkMath.radiansFromDegrees(model.activeCamera.getViewAngle());
const parallelScale = radius;
const distance = radius / Math.sin(angle * 0.5);
Expand Down
Loading