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

New Feature: spotLight() #3894

Closed
2 tasks done
sanketsingh24 opened this issue Jul 16, 2019 · 1 comment
Closed
2 tasks done

New Feature: spotLight() #3894

sanketsingh24 opened this issue Jul 16, 2019 · 1 comment

Comments

@sanketsingh24
Copy link
Contributor

Nature of issue?

  • New feature request

Most appropriate sub-area of p5.js?

  • WebGL

New feature details:

As a part of the Summer of Code, I will be implementing spotLight() along with @aferriss in src/webgl/light.js. The function will be-
spotLight(color, position, direction, angle, concentration).

Problems-
  1. The arguments angle and concentration doesn't seem to reflect what they are used for.

    • angle is the maximum dispersion of light from its direction, ie angle of the cone.
    • concentration is the attenuation of the spotLight().
      Some alternatives which we could think of-
    • angle - projection angle, opening angle, spread
    • concentration - falloff, intensity, attenuation
  2. We had thought of setting angle and concentration as default to PI/3 and 1 respectively.
    But now, we have no means to distinguish between the two of them if the user sets only one of them. So we have thought that If the user wants to set the concentration, he also has to set the angle. So the usage of function would be like this-

    • spotLight(color, position, direction)
    • spotLight(color, position, direction, angle)
    • spotLight(color, position, direction, angle, concentration)
@aferriss
Copy link
Contributor

Closing because this is merged in #3913

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

No branches or pull requests

2 participants