lights

package
v0.0.0-...-405cb25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lights provides implementations of the tracer.Light interface.

  • general transform (either orthonormal or scales intensity)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskLight

func DiskLight(brightness Color, diam float64, center Vec) Light

func PointLight

func PointLight(power Color, pos Vec) Light

func RectangleLight

func RectangleLight(brightness Color, w, h float64, center Vec) Light

func SunLight

func SunLight(brightnessAtEarth Color, angularDiam float64, yaw, pitch float64) Light

SunLight constructs a far-away circlular light source, like the sun. angularDiam is the angular diameter (in radians).

The angular diameter of the sun seem from the earth is about 0.53 degrees (https://en.wikipedia.org/wiki/Angular_diameter#Use_in_astronomy)

brightnessAtEarth is the brightness that a 100% reflective matte surface receives when perpendicular to the sunlight. A brightness of (1,1,1) is thus easy to understand: this is the highest brightness that is guaranteed not to overexpose any scene.

yaw is the horizontal angle with respect to the -z axis. Thus 0 degree yaw means the sun is in the north.

pitch is the vertical angle above the horizon. 90 degree pitch means the sun is in the zenith.

func Transformed

func Transformed(l Light, t *geom.AffineTransform) Light

Transformed returns a transformed instance of the original light. The transform may be a rotation and/or scale (equal in all directions), but not an anistropic scale or shear, etc.

Multiple transformed instances of the same object may be made, they efficiently share underlying state.

TODO: if object is already an instance of *transformed, combine both transforms into one.

TODO: arguments: first transform, then object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL