Skip to content

Book 2 section "Interior Testing of The Intersection Using UV Coordinates": expand on alternative primitives #1205

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

Closed
hollasch opened this issue Aug 11, 2023 · 0 comments · Fixed by #1212
Assignees
Milestone

Comments

@hollasch
Copy link
Collaborator

The current text reads like so:

Pause a bit here and consider that if you use the (α,β) coordinates to determine if a point lies inside a quadrilateral (parallelogram), it's not too hard to imagine using these same 2D coordinates to determine if the intersection point lies inside any other 2D (planar) primitive!

We'll leave these additional 2D shape possibilities as an exercise to the reader, depending on your desire to explore. Consider triangles, disks, and rings (all of these are surprisingly easy). You could even create cut-out stencils based on the pixels of a texture map, or a Mandelbrot shape!

We should flesh this out just a tiny bit more. Perhaps move this text after the next listing, and mention that one would only need to write a different is_interior(double a, double b, hit_record& rec) function that returns whether a given input coordinate (a,b) is inside the primitive. We might also supply the text describing how we'd do this for disks to get folks thinking.

@hollasch hollasch added this to the v4.0.0 milestone Aug 11, 2023
@hollasch hollasch self-assigned this Aug 11, 2023
hollasch added a commit that referenced this issue Aug 14, 2023
This does two things:

- Moves the planar coordinates derivation into its own skippable
  section.

- Moves the alternate 2D primitives discussion to its own section at the
  end of the quad chapter, and points to the `alternate-2D-primitves`
  tag for triangles, ellipses, and annuli.

Resolves #1204
Resolves #1205
hollasch added a commit that referenced this issue Aug 16, 2023
This does two things:

- Moves the planar coordinates derivation into its own skippable
  section.

- Moves the alternate 2D primitives discussion to its own section at the
  end of the quad chapter, and points to the `alternate-2D-primitves`
  tag for triangles, ellipses, and annuli.

Resolves #1204
Resolves #1205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant