aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/main.go b/main.go
index 957fc92..1330e74 100644
--- a/main.go
+++ b/main.go
@@ -5,7 +5,7 @@ import (
"math"
"math/rand"
- "github.com/schollz/progressbar"
+ "github.com/schollz/progressbar/v3"
)
const (
@@ -55,14 +55,13 @@ func main() {
// move := Vec3D{2.0, 0.0, 0.0}
frame := Frame{}
bar := progressbar.New(Height)
- bar.RenderBlank()
// for k := 0; k < FPS*DURATION; k++ {
// origin := AddVec3D(start, ScalarProduct(float64(k)/float64(FPS*DURATION), move))
// camera.origin = origin
- for x := 0; x < Height; x++ {
- for y := 0; y < Width; y++ {
+ for x := range Height {
+ for y := range Width {
var colorList [RaysPerPixel]Color
- for it := 0; it < RaysPerPixel; it++ {
+ for it := range RaysPerPixel {
u := (float64(y) + rand.Float64()) / float64(Width)
v := (float64(x) + rand.Float64()) / float64(Height)
ray := camera.GetRay(u, v)