MCPcopy
hub / github.com/fogleman/ln / main

Function main

examples/test.go:11–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9}
10
11func main() {
12 scene := ln.Scene{}
13 n := 20
14 for x := -n; x <= n; x++ {
15 for y := -n; y <= n; y++ {
16 // z := rand.Float64() * 3
17 // scene.Add(cube(float64(x), float64(y), float64(z)))
18 // scene.Add(cube(float64(x), float64(y), float64(z+1)))
19 // scene.Add(cube(float64(x), float64(y), float64(z+2)))
20 }
21 }
22 n = 8
23 for x := -n; x <= n; x++ {
24 for y := -n; y <= n; y++ {
25 scene.Add(ln.NewSphere(ln.Vector{float64(x), float64(y), 0}, 0.45))
26 }
27 }
28 // scene.Add(ln.NewSphere(ln.Vector{0, 4, 0}, 4))
29 // scene.Add(ln.NewSphere(ln.Vector{-7, 0, 0}, 4))
30 // scene.Add(ln.NewSphere(ln.Vector{7, 0, 0}, 4))
31 eye := ln.Vector{8, 8, 1}
32 center := ln.Vector{0, 0, -4.25}
33 up := ln.Vector{0, 0, 1}
34 width := 1024.0
35 height := 1024.0
36 paths := scene.Render(eye, center, up, width, height, 50, 0.1, 100, 0.01)
37 paths.WriteToPNG("out.png", width, height)
38 // paths.Print()
39}

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
RenderMethod · 0.95
WriteToPNGMethod · 0.80

Tested by

no test coverage detected