-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add ability to specify light direction and color #2
Comments
Good idea. isomer.js specifies the direction like so: /**
* Light source as defined as the angle from
* the object to the source.
*
* We'll define somewhat arbitrarily for now.
*/
this.lightAngle = new Isomer.Vector(2, -1, 3).normalize(); So you could technically write As for color, I currently compute that in /**
* Brightness is between -1 and 1 and is computed based
* on the dot product between the light source vector and normal.
*/
var brightness = Vector.dotProduct(normal, this.lightAngle);
var color = baseColor.lighten(brightness * this.colorDifference); I guess |
Let me know if we need to make any improvements to this. Might be due for a vocabulary check... |
Sure thing. Vocabulary is fine for now. Some of the terms aren't really needed unless you start to expand into lots of options for drawing. |
options.lightPosition
options.lightColor
The text was updated successfully, but these errors were encountered: