// 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 *Tube) Start(a *app.App) {
	a.Camera().SetPosition(0, 10, 80)
	l1 := light.NewDirectional(&math32.Color{1, 0, 0}, 1.0)
	l1.SetPosition(1, 0, 0)
	a.Scene().Add(l1)
	l2 := light.NewDirectional(&math32.Color{0, 1, 0}, 1.0)
	l2.SetPosition(0, 1, 0)
	a.Scene().Add(l2)
	l3 := light.NewDirectional(&math32.Color{0, 0, 1}, 1.0)
	l3.SetPosition(0, 0, 1)
	a.Scene().Add(l3)
	var path []math32.Vector3
	var i float64
	for i = 0; i <= 100; i++ {
		x := math.Cos(math.Pi * 2 *i/10)*3
		y := i / 3
		z := math.Sin(math.Pi * 2 *i/10)*3
		path = append(path, *math32.NewVector3(float32(x), float32(y), float32(z)));
	}
	c := geometry.NewTube(path, 1, 8, true)
	mat := material.NewStandard(&math32.Color{1, 1, 1})
	mat.SetSide(material.SideDouble)
	t.mesh = graphic.NewMesh(c, mat)
	a.Scene().Add(t.mesh)
	axes := helper.NewAxes(2)
	a.Scene().Add(axes)
}
func ( t * Tube ) Start ( a * app . App ) { a . Camera ( ) . SetPosition ( 0 , 10 , 80 ) l1 := light . NewDirectional ( & math32 . Color { 1 , 0 , 0 } , 1.0 ) l1 . SetPosition ( 1 , 0 , 0 ) a . Scene ( ) . Add ( l1 ) l2 := light . NewDirectional ( & math32 . Color { 0 , 1 , 0 } , 1.0 ) l2 . SetPosition ( 0 , 1 , 0 ) a . Scene ( ) . Add ( l2 ) l3 := light . NewDirectional ( & math32 . Color { 0 , 0 , 1 } , 1.0 ) l3 . SetPosition ( 0 , 0 , 1 ) a . Scene ( ) . Add ( l3 ) var path [ ] math32 . Vector3 var i float64 for i = 0 ; i <= 100 ; i ++ { x := math . Cos ( math . Pi * 2 * i / 10 ) * 3 y := i / 3 z := math . Sin ( math . Pi * 2 * i / 10 ) * 3 path = append ( path , * math32 . NewVector3 ( float32 ( x ) , float32 ( y ) , float32 ( z ) ) ) ; } c := geometry . NewTube ( path , 1 , 8 , true ) mat := material . NewStandard ( & math32 . Color { 1 , 1 , 1 } ) mat . SetSide ( material . SideDouble ) t . mesh = graphic . NewMesh ( c , mat ) a . Scene ( ) . Add ( t . mesh ) axes := helper . NewAxes ( 2 ) a . Scene ( ) . Add ( axes ) }
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 // Create axes helper