diff options
Diffstat (limited to 'camera.go')
| -rw-r--r-- | camera.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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), ), |
