-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpresets_test.go
51 lines (40 loc) · 1.22 KB
/
presets_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* rigo/presets_test.go */
package rigo
import (
"fmt"
"testing"
. "github.com/mae-global/rigo/ri"
. "github.com/smartystreets/goconvey/convey"
)
func Test_Presets(t *testing.T) {
Convey("Presets", t, func() {
Convey("Strict Pipeline -- no extentions", func() {
ctx, pipe := StrictPipeline()
So(ctx, ShouldNotBeNil)
ctx.Begin("output/strict/simple.rib")
ctx.Display("sphere.tif", "file", "rgb")
ctx.Format(320, 240, 1)
ctx.Projection(PERSPECTIVE, RtString("fov"), RtFloat(30))
ctx.Translate(0, 0, 6)
ctx.WorldBegin()
ctx.LightSource("ambientlight", RtString("intensity"), RtFloat(0.5))
ctx.LightSource("distantlight", RtString("intensity"), RtFloat(1.2), RtString("form"), RtIntArray{0, 0, -6}, RtString("to"), RtIntArray{0, 0, 0})
ctx.Color(RtColor{1, 0, 0})
ctx.Sphere(1, -1, 1, 360)
ctx.WorldEnd()
So(ctx.End(), ShouldBeNil)
/* output gathered stats */
p := pipe.GetByName(PipeToStats{}.Name())
So(p, ShouldNotBeNil)
s, ok := p.(*PipeToStats)
So(s, ShouldNotBeNil)
So(ok, ShouldBeTrue)
p = pipe.GetByName(PipeTimer{}.Name())
So(p, ShouldNotBeNil)
t, ok := p.(*PipeTimer)
So(t, ShouldNotBeNil)
So(ok, ShouldBeTrue)
fmt.Printf("%s%s", s, t)
})
})
}