Skip to content

go4orward/gowebgl

Repository files navigation

GoWebGL : Interactive Graphics in Go

Interactive 2D & 3D Graphics Library using Go + WebAssembly + WebGL

=========================================================
THIS PROJECT WAS MOVED TO A NEW REPOSITORY GIGL (May 9, 2021),
WHICH ALREADY INCLUDES SIGNIFICANT IMPROVEMENTS.
NO FURTHER DEVELOPMENT WILL BE MADE TO THIS PROJECT. =========================================================

How to Build & Run

Simplest example:   (for explaining how WebGL works)

$ make                  # source : 'webgl1st_example.go'
$ ./wasm_test_server    # open your browser, and visit http://localhost:8080

webgl1st_example result

2D example:   (with animation & user interactions)

$ make 2d               # source : 'webgl2d_example.go'
$ ./wasm_test_server    # open your browser, and visit http://localhost:8080
or
$ make 2dui             # source : 'webgl2dui_example.go'
$ ./wasm_test_server    # open your browser, and visit http://localhost:8080

webgl2d_example result

3D example:   (with perspective & orthographic camera)

$ make 3d               # source : 'webgl3d_example.go'
$ ./wasm_test_server    # open your browser, and visit http://localhost:8080

webgl3d_example result

Globe example:   (with perspective & orthographic camera)

$ make globe            # source : 'webglglobe_example.go'
$ ./wasm_test_server    # open your browser, and visit http://localhost:8080

webglglobe_example result

ToDo List

  • overlay (marker/label) layers for Globe
  • user selection using collision detection with a ray from camera
  • graticules on the globe
  • coast lines and country border lines on the world map
  • support for world map projections (Mercator, Stereographic, etc)
  • 'webglgalaxy' maybe? :)

Thanks

I hope this project can help many people to learn WebGL and to build awesome 2D & 3D graphics applications.
Many thanks to Richard Musiol, for his vision and contributions for GopherJS and WebAssembly for Go. If you hava a feedback or suggestion, contact go4orward.

Resources taken from: