Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lighting

Lighting Functions


Description

Functions to compute colors modified for lighting effects.

Usage

phongLighting(normals, view, light, color, color2, alpha, material = "default")
perspLighting(normals, view, light, color, color2, alpha, material = "default")

Arguments

normals

numeric matrix with three columns representing surface normal vectors.

view

numeric vector of length 3 representing the direction to the viewer.

light

numeric vector of length 3 or 4. The first three elements represent the direction to the light. The fourth element, if present, represents light intensity; the default is 1.

color

colors to use for faces in the direction of the normal vectors.

color2

opposite face color.

alpha

alpha channel level, a number between 0 and 1.

material

material specification. Currently possible values are the character strings "dull", "shiny", "metal", and "default".

Details

phongLighting uses the Phong lighting model to compute colors modified for view direction, light direction, and material properties. perspLighting implements approximately the same lighting model as the persp function.

Value

Vector of color specifications.


misc3d

Miscellaneous 3D Plots

v0.9-0
GPL
Authors
Dai Feng and Luke Tierney
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.