func (g *Geometry) buildScale() func(float64, float64, float64) *Geometry { // scale geometry var m1 math3d.Matrix4 return func(x, y, z float64) *Geometry { if m1 == nil { m1 = math3d.NewMatrix4() } m1.MakeScale(x, y, z) g.ApplyMatrix(m1) return g } }
func (g *Geometry) buildRotateY() func(angle float64) *Geometry { // rotate geometry around world y-axis var m1 math3d.Matrix4 return func(angle float64) *Geometry { if m1 == nil { m1 = math3d.NewMatrix4() } m1.MakeRotationY(angle) g.ApplyMatrix(m1) return g } }
func (g *Geometry) buildTranslate() func(float64, float64, float64) *Geometry { // translate geometry var m1 math3d.Matrix4 return func(x, y, z float64) *Geometry { if m1 == nil { m1 = math3d.NewMatrix4() } m1.MakeTranslation(x, y, z) g.ApplyMatrix(m1) return g } }