A simple 3D terrain visualizer written in Go. When developing this project, I quickly found out how mildly inconvenient it is to do any form of computer graphics programming in a language without support for classes, static fields/methods, operator overloading, and even implicit narrowing conversions. Nevertheless, I wanted to try out Golang, so I thought I'd rewrite something I'm familiar with even if it may not be the best use case for the language. I used raylib and raylib-go for creating windows and drawing lines/vertices, and did the rest of the rendering on the cpu.
Features include:
- A fully controllable camera in 3d space
- A controllable sphere along the terrain's surface
- Variable terrain hill size and mesh resolution
- Backface culling
- Terrain rasterization (doesn't actually color the polygons correctly but generates a solid terrain)
- Install cgo
apt-get install libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libwayland-dev libxkbcommon-dev
- Install raylib-go
go install -v github.com/gen2brain/raylib-go/raylib@latest
- Build the project
go build .
