blob: 04896dc79bf515fdc8211f67dbdc0cc9bf2b8caa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// vim: shiftwidth=4 tabstop=4 noexpandtab
package main
// representation of a three-dimensional point in space
type Point struct {
scalars [3]float32 // x = scalars[0], y = scalars[1], z = scalars[2]
}
// a triangle consists of three points
type Triangle struct {
points [3]*Point
}
// a surface is made of a slice of triangles
type Surface struct {
triangles []*Triangle
}
|