Documentation ¶
Overview ¶
Package api provides a high-level API for defining BruteRay scenes. This is the only package users usually need to interact with.
Index ¶
- Constants
- Variables
- func Animate(numFrame int, f func(frame int) Spec)
- func Render(spec Spec)
- func Serve(addr string, spec Spec) error
- type Color
- type Light
- type Material
- type Medium
- type Object
- func Backdrop(m Material) Object
- func Bounded(orig Object) Object
- func Box(m Material, dx, dy, dz float64, center Vec) Object
- func BoxWithBounds(m Material, min, max Vec) Object
- func Cylinder(m Material, diam, height float64, center Vec) Object
- func CylinderWithCaps(m Material, diam, height float64, center Vec) Object
- func CylinderX(m Material, diam, height float64, center Vec) Object
- func CylinderZ(m Material, diam, height float64, center Vec) Object
- func Difference(a, b Object) Object
- func IsoSurface(m Material, dx, dy, dz float64, f func(u, v float64) float64) Object
- func ObjFile(m map[string]Material, file string, transf ...*geom.AffineTransform) Object
- func Parametric(m Material, numU, numV int, f func(u, v float64) Vec) Object
- func PlyFile(m Material, file string, transf ...*geom.AffineTransform) Object
- func Rectangle(m Material, dx, dz float64, center Vec) Object
- func RectangleWithVertices(m Material, o, a, b Vec) Object
- func Sphere(m Material, diam float64, center Vec) Object
- func Tree(children ...Object) Object
- func (o Object) And(b Object) Object
- func (o Object) AndNot(b Object) Object
- func (o Object) Bounds() objects.BoundingBox
- func (o Object) Center() Vec
- func (o Object) CenterBack() Vec
- func (o Object) CenterBottom() Vec
- func (o Object) CenterFront() Vec
- func (o Object) CenterTop() Vec
- func (o Object) Or(b Object) Object
- func (o Object) Remap(f func(Vec) Vec) Object
- func (o Object) Remove(b Object) Object
- func (o Object) Restrict(bounds Object) Object
- func (o Object) Rotate(axis Vec, radians float64) Object
- func (o Object) RotateAt(center Vec, axis Vec, radians float64) Object
- func (o Object) Scale(s float64) Object
- func (o Object) ScaleAt(center Vec, s float64) Object
- func (o Object) ScaleToSize(maxSize float64) Object
- func (o Object) Transform(tr *geom.AffineTransform) Object
- func (o Object) Translate(delta Vec) Object
- func (o Object) WithCenter(pos Vec) Object
- func (o Object) WithCenterBottom(pos Vec) Object
- func (o Object) WithMaterial(m Material) Object
- type Spec
- type Texture
- type Vec
- type View
Constants ¶
View Source
const SpecMaxDebugNormals = 2
Variables ¶
View Source
var ( And = objects.And Not = objects.Not Black = colorf.Black Blue = colorf.Blue Cyan = colorf.Cyan Gray = colorf.Gray Green = colorf.Green Magenta = colorf.Magenta Red = colorf.Red White = colorf.White Yellow = colorf.Yellow RectangleLight = lights.RectangleLight PointLight = lights.PointLight DiskLight = lights.DiskLight SunLight = lights.SunLight Matte = materials.Matte Reflective = materials.Reflective Refractive = materials.Refractive Transparent = materials.Transparent Flat = materials.Flat Shiny = materials.Shiny Blend = materials.Blend BlendMap = materials.BlendMap ReflectFresnel = materials.ReflectFresnel ExpFog = media.ExpFog Fog = media.Fog Ex = geom.Ex Ey = geom.Ey Ez = geom.Ez O = geom.O )
View Source
var ( Projective = cameras.Projective ProjectiveAperture = cameras.ProjectiveAperture EnvironmentMap = cameras.EnvironmentMap )
View Source
var (
JPEGQuality = 90
)
Functions ¶
Types ¶
type Object ¶
func BoxWithBounds ¶
func Difference ¶
func IsoSurface ¶
func RectangleWithVertices ¶
func (Object) Bounds ¶
func (o Object) Bounds() objects.BoundingBox
func (Object) CenterBack ¶
func (Object) CenterBottom ¶
func (Object) CenterFront ¶
func (Object) ScaleToSize ¶
func (Object) WithCenter ¶
func (Object) WithCenterBottom ¶
func (Object) WithMaterial ¶
type Spec ¶
type Spec struct { Lights []Light Objects []Object Media []Medium Camera tracer.Camera Recursion int NumPass int Width int Height int DebugNormals int DebugIsometricFOV float64 DebugIsometricDir int PostProcess post.Params }
A Spec specifies a BruteRay scene. Usage:
Render(Spec{ ... })
Click to show internal directories.
Click to hide internal directories.