Documentation
¶
Index ¶
- Constants
- Variables
- func Cube() *model.Mesh
- func Cylinder() *model.Mesh
- func Extrude(profile manifold.Polygon, path tensor.Vec3) *model.Mesh
- func InterpretModels(paths []string) ([]model.Model, error)
- func PrintInterpErr(path string, err error)
- func Revolve(profile manifold.Polygon, axis tensor.Vec3, resolution int) *model.Mesh
- func Rotate(angle float64, axis tensor.Vec3) model.Transform
- func Scale(x, y, z float64) model.Transform
- func ScaleUniform(v float64) model.Transform
- func ScaleV(v tensor.Vec3) model.Transform
- func Sphere() *model.Mesh
- func Spin(rate float64, axis tensor.Vec3) model.Transform
- func Torus(r1, r2 float64) *model.Mesh
- func Translate(x, y, z float64) model.Transform
- func TranslateV(v tensor.Vec3) model.Transform
- type FrameCapture
- type Host
- type Key
- type Renderer
- func (r *Renderer) Add(m model.Model, t ...model.Transform)
- func (r *Renderer) Cleanup()
- func (r *Renderer) EnableDebug(ok bool)
- func (r *Renderer) Init() error
- func (r *Renderer) Prepare(cull bool) error
- func (r *Renderer) Render(width, height int, g model.Globals) time.Duration
- func (r *Renderer) SetFrameCapture(fn FrameCapture) bool
- func (r *Renderer) Tick(delta, runtime time.Duration) bool
- type UI
Constants ¶
View Source
const HorizRadPerSec = math.Pi / 2
View Source
const MovePerSec = 10
View Source
const VertRadPerSec = math.Pi / 2
Variables ¶
View Source
var DefaultLights = []model.Light{ { Position: tensor.Vec3{6, 5, 7}, Ambient: glu.Color.W.Mul(0.6), Diffuse: glu.Color.W.Mul(0.5), Specular: glu.Color.W.Mul(0.1), }, }
View Source
var DefaultModel = model.Body{ Skybox, Cube().With(Spin(math.Pi/2, tensor.Vec3{1, 1, 1}.Normalize()), move, spin), Cylinder().With(Spin(-math.Pi/2, tensor.Vec3{1, 0, 0}), move, Rotate(math.Pi*2/3, tensor.Vec3{0, 1, 0}), spin), Sphere().With(ScaleUniform(0.5), move, Rotate(math.Pi*4/3, tensor.Vec3{0, 1, 0}), spin), Torus(0.15, 0.4).With(Spin(math.Pi/2, tensor.Vec3{1, 0, 0}), Spin(math.Pi/3, tensor.Vec3{0, 0, 1})), }
View Source
var Skybox = new(model.Skybox).With(ScaleUniform(100))
Functions ¶
func PrintInterpErr ¶ added in v0.0.2
func ScaleUniform ¶ added in v0.0.2
Types ¶
type FrameCapture ¶ added in v0.0.2
type Host ¶ added in v0.0.2
type Host interface {
// is debugging enabled?
DebugEnabled() bool
// is face culling enabled?
CullingEnabled() bool
// viewport size
Size() (width, height int)
// trigger a draw
QueueDraw()
// add a tick function
AddTick(func(time.Duration)) (clear func(), err error)
// get text font
GetFont() (font.Face, error)
// lights
Lights() []model.Light
}
type Renderer ¶ added in v0.0.2
type Renderer struct {
// contains filtered or unexported fields
}
func (*Renderer) EnableDebug ¶ added in v0.0.2
func (*Renderer) SetFrameCapture ¶ added in v0.0.2
func (r *Renderer) SetFrameCapture(fn FrameCapture) bool
type UI ¶ added in v0.0.2
type UI struct {
// contains filtered or unexported fields
}
func (*UI) SetFrameCapture ¶ added in v0.0.2
func (ui *UI) SetFrameCapture(fn FrameCapture) bool
Click to show internal directories.
Click to hide internal directories.