MCPcopy Index your code
hub / github.com/fogleman/ln / render

Function render

examples/graph.go:10–124  ·  view source on GitHub ↗
(frame int)

Source from the content-addressed store, hash-verified

8)
9
10func render(frame int) {
11 cx := math.Cos(ln.Radians(float64(frame)))
12 cy := math.Sin(ln.Radians(float64(frame)))
13 scene := ln.Scene{}
14 eye := ln.Vector{cx, cy, 0}.MulScalar(8)
15 center := ln.Vector{0, 0, 0}
16 up := ln.Vector{0, 0, 1}
17
18 nodes := []ln.Vector{
19 {1.047, -0.000, -1.312},
20 {-0.208, -0.000, -1.790},
21 {2.176, 0.000, -2.246},
22 {1.285, -0.001, 0.016},
23 {-1.276, -0.000, -0.971},
24 {-0.384, 0.000, -2.993},
25 {-2.629, -0.000, -1.533},
26 {-1.098, -0.000, 0.402},
27 {0.193, 0.005, 0.911},
28 {-1.934, -0.000, 1.444},
29 {2.428, -0.000, 0.437},
30 {0.068, -0.000, 2.286},
31 {-1.251, -0.000, 2.560},
32 {1.161, -0.000, 3.261},
33 {1.800, 0.001, -3.269},
34 {2.783, 0.890, -2.082},
35 {2.783, -0.889, -2.083},
36 {-2.570, -0.000, -2.622},
37 {-3.162, -0.890, -1.198},
38 {-3.162, 0.889, -1.198},
39 {-1.679, 0.000, 3.552},
40 {1.432, -1.028, 3.503},
41 {2.024, 0.513, 2.839},
42 {0.839, 0.513, 4.167},
43 // {0.000000, 0.000000, 0.000000},
44 // {0.000000, 0.000000, 1.089000},
45 // {1.026719, 0.000000, -0.363000},
46 // {-0.513360, -0.889165, -0.363000},
47 // {-0.513360, 0.889165, -0.363000},
48 //
49 // {0, 0, 0},
50 // {-1, 0, 0},
51 // {1, 0, 0},
52 // {0, 1, 0},
53 // {0, -1, 0},
54 // {0, 0, 1},
55 // {0, 0, -1},
56 //
57 // {-1, 1, 1},
58 // {-1, 1, -1},
59 // {-1, -1, 1},
60 // {-1, -1, -1},
61 // {1, 1, 1},
62 // {1, 1, -1},
63 // {1, -1, 1},
64 // {1, -1, -1},
65 }
66
67 edges := [][2]int{

Callers 1

mainFunction · 0.85

Calls 13

AddMethod · 0.95
RenderMethod · 0.95
MulScalarMethod · 0.80
SubMethod · 0.80
LengthMethod · 0.80
NormalizeMethod · 0.80
CrossMethod · 0.80
DotMethod · 0.80
TranslateMethod · 0.80
RotateMethod · 0.80
MulPositionMethod · 0.80
InverseMethod · 0.80

Tested by

no test coverage detected