From 77901bb05dbf75e92dd8974ccb23053bb3b2dabf Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 16 Mar 2022 20:54:19 +0100 Subject: Add docstrings --- geometry.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'geometry.go') diff --git a/geometry.go b/geometry.go index 80420a6..fdbbcef 100644 --- a/geometry.go +++ b/geometry.go @@ -6,22 +6,23 @@ import ( "github.com/go-gl/mathgl/mgl32" ) -// representation of a three-dimensional point in space +// Point represents 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 +// Triangle is a geometrical triangle defined by three points. type Triangle struct { points [3]*Point } -// a surface is made of a slice of triangles +// Surface is a slice of triangles. type Surface struct { triangles []*Triangle } -// return a transformation to view the whole centered surface +// getHomeView returns a transformation which shows the given Surface in the +// center of the window. func (s Surface) getHomeView() mgl32.Mat4 { // evaluating the smallest and biggest values for x,y,z of the surface -- cgit v1.2.3-70-g09d2