aboutsummaryrefslogtreecommitdiff
path: root/camera.go
diff options
context:
space:
mode:
Diffstat (limited to 'camera.go')
-rw-r--r--camera.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/camera.go b/camera.go
index 6575390..6cc3391 100644
--- a/camera.go
+++ b/camera.go
@@ -1,15 +1,17 @@
package main
+// Camera handle view position and screen
type Camera struct {
- lower_left_corner Vec3D
+ lowerLeftCorner Vec3D
origin, horizontal, vertical Vec3D
}
+// GetRay computes Ray given screen params
func (camera Camera) GetRay(u float64, v float64) Ray {
return Ray{
camera.origin,
AddVec3D(AddVec3D(
- camera.lower_left_corner,
+ camera.lowerLeftCorner,
ScalarProduct(u, camera.horizontal)),
ScalarProduct(v, camera.vertical),
),