material

package
Version: v0.0.0-...-1b60a0e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package material represents a material on the surface of an object.

Index

Constants

View Source
const (
	// DefaultAmbient is the ambient reflection factor of a default material.
	DefaultAmbient = 0.1
	// DefaultDiffuse is the diffuse reflection factor of a default material.
	DefaultDiffuse = 0.9
	// DefaultSpecular is the specular reflection factor of a default material.
	DefaultSpecular = 0.9
	// DefaultShininess is the shininess factor of a default material.
	DefaultShininess = 200.0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Material

type Material struct {
	// The Color of the material. Default: white
	Color color.Color
	// The Ambient reflection of the material. Range is [0, 1]. Default is 0.1.
	Ambient float64
	// The Diffuse reflection of the material. Range is [0, 1]. Default is 0.9
	Diffuse float64
	// The Specular reflection of the material. Range is [0, 1]. Default is 0.9
	Specular float64
	// The Shininess of the material. Range is [10, 200]. Default is 200.0
	Shininess float64
}

Material represents a material on the surface of an object. It uses the Phong reflection model to simulate the reflection of light.

func NewDefaultMaterial

func NewDefaultMaterial() *Material

NewDefaultMaterial returns a new Material with default values.

func NewMaterial

func NewMaterial(c color.Color, ambient, diffuse, specular, shininess float64) *Material

NewMaterial returns a new Material having the passed values.

Source Files

Jump to

Keyboard shortcuts

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