diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 11:23:39 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 11:23:39 +0200 |
| commit | bf6560bb2007581892932a367f4319f2f2a01919 (patch) | |
| tree | e25324d3ba5225e8abca83a57c2af10c64c10cda /main.go | |
| parent | 4c823f57959a5d821a9f00d8e8c7f57c08ac2ded (diff) | |
- init go.mod (Go 1.27, progressbar/v3 v3.19.1) and fix import
- fix FMin returning max, remove deprecated RenderBlank, apply go fix range loops
- add mise.toml (go 1.27, tasks: build/run/check with go fix -diff/clean)
- add focused README and update .gitignore for build artifacts
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) |
