// Start is called once at the start of the demo.
Start is called once at the start of the demo.
// Start is called once at the start of the demo .
func (t *Sphere) Start(a *app.App) {
	l1 := light.NewDirectional(&math32.Color{1, 0, 0}, 1.0)
	l1.SetPosition(0.1, 0, 0)
	a.Scene().Add(l1)
	l2 := light.NewDirectional(&math32.Color{0, 1, 0}, 1.0)
	l2.SetPosition(0, 0.1, 0)
	a.Scene().Add(l2)
	l3 := light.NewDirectional(&math32.Color{0, 0, 1}, 1.0)
	l3.SetPosition(0, 0, 0.1)
	a.Scene().Add(l3)
	geom1 := geometry.NewSphere(1, 16, 8)
	mat1 := material.NewStandard(&math32.Color{0, 0, 0.6})
	mat1.SetWireframe(true)
	mat1.SetSide(material.SideDouble)
	t.sphere1 = graphic.NewMesh(geom1, mat1)
	t.sphere1.SetPosition(-1.5, 0, 0)
	a.Scene().Add(t.sphere1)
	geom2 := geometry.NewSphere(1, 32, 16)
	mat2 := material.NewStandard(&math32.Color{1, 1, 1})
	mat2.SetWireframe(false)
	mat2.SetSide(material.SideDouble)
	t.sphere2 = graphic.NewMesh(geom2, mat2)
	t.sphere2.SetPosition(1.5, 0, 0)
	a.Scene().Add(t.sphere2)
	axes := helper.NewAxes(2)
	a.Scene().Add(axes)
	t.normals = helper.NewNormals(t.sphere1, 0.5, &math32.Color{0, 1, 0}, 1)
	a.Scene().Add(t.normals)
}
func ( t * Sphere ) Start ( a * app . App ) { l1 := light . NewDirectional ( & math32 . Color { 1 , 0 , 0 } , 1.0 ) l1 . SetPosition ( 0.1 , 0 , 0 ) a . Scene ( ) . Add ( l1 ) l2 := light . NewDirectional ( & math32 . Color { 0 , 1 , 0 } , 1.0 ) l2 . SetPosition ( 0 , 0.1 , 0 ) a . Scene ( ) . Add ( l2 ) l3 := light . NewDirectional ( & math32 . Color { 0 , 0 , 1 } , 1.0 ) l3 . SetPosition ( 0 , 0 , 0.1 ) a . Scene ( ) . Add ( l3 ) geom1 := geometry . NewSphere ( 1 , 16 , 8 ) mat1 := material . NewStandard ( & math32 . Color { 0 , 0 , 0.6 } ) mat1 . SetWireframe ( true ) mat1 . SetSide ( material . SideDouble ) t . sphere1 = graphic . NewMesh ( geom1 , mat1 ) t . sphere1 . SetPosition ( - 1.5 , 0 , 0 ) a . Scene ( ) . Add ( t . sphere1 ) geom2 := geometry . NewSphere ( 1 , 32 , 16 ) mat2 := material . NewStandard ( & math32 . Color { 1 , 1 , 1 } ) mat2 . SetWireframe ( false ) mat2 . SetSide ( material . SideDouble ) t . sphere2 = graphic . NewMesh ( geom2 , mat2 ) t . sphere2 . SetPosition ( 1.5 , 0 , 0 ) a . Scene ( ) . Add ( t . sphere2 ) axes := helper . NewAxes ( 2 ) a . Scene ( ) . Add ( axes ) t . normals = helper . NewNormals ( t . sphere1 , 0.5 , & math32 . Color { 0 , 1 , 0 } , 1 ) a . Scene ( ) . Add ( t . normals ) }
Start is called once at the start of the demo.
Start is called once at the start of the demo .
// Add directional red light from right // Add directional green light from top // Add directional blue light from front // Creates sphere 1 // Creates sphere 2 // Create axes helper // Adds normals helper