INNER CODE UNIT · Go
func
g3n/g3nd · demos/animation/basic.go:27
func (t *AnimationBasic) Start(a *app.App) {
ah := helper.NewAxes(1.0)
a.Scene().Add(ah)
// Adds white directional front light
dir1 := light.NewDirectional(&math32.Color{1, 1, 1}, 1.0)
dir1.SetPosition(0, 5, 10)
a.Scene().Add(dir1)
// Add box
geom := geometry.NewSegmentedCube(1, 2)
mat := material.NewStandard(&math32.Color{0.5, 0, 0})
mat.SetWireframe(false)
box := graphic.NewMesh(geom, mat)
a.Scene().Add(box)
// Create a looping animation