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