Skip to content

go4orward/gigl

Repository files navigation

GIGL : Interactive 2D & 3D Graphics Library in Go

GIGL implements full set of high-level constructs of interactive 2D & 3D graphics (such as Camera, Scene, Geometry, Material, Overlay, etc.) entirely in Go, so that they can be easily used in any OpenGL/WebGL environments on native applications or webapps in a browser.

This project is under development, and backward-incompatible changes can be made.

How to Build & Run

Simplest example:   (for explaining how WebGL/OpenGL works)

$ make webgl_1st        # source : 'tutorial/webgl_1st/webgl_1st.go'
$ make webgl_run
or
$ make opengl_1st       # source : 'tutorial/opengl_1st/opengl_1st.go'

webgl_1st_example result

2D example:   (for basic 2D usage with Geometry)

$ make webgl_2d         # source : 'tutorial/webgl_2d/webgl_2d.go'
$ make webgl_run
or
$ make opengl_2d        # source : 'tutorial/opengl_2d/opengl_2d.go'

webgl_2d_example result

2Di example:   (with Geometry Instaces, Labels & Markers)

$ make webgl_2di        # source : 'tutorial/webgl_2di/webgl_2di.go'
$ make webgl_run

webgl_2d_example result

3D example:   (basic 3D usage with Geometry, Texture and Camera)

$ make webgl_3d        # source : 'tutorial/webgl_3d/webgl_3d.go'
$ make webgl_run
or
$ make opengl_3d       # source : 'tutorial/opengl_3d/opengl_3d.go'

webgl_3d_example result

Spinnig Globe example:   (with a specialized sphere geometry, glow effect, and user interactions)

$ make webgl_globe    # source : 'tutorial/webgl_globe/webgl_globe.go'
$ make webgl_run

webgl_globe_example result

ToDo List

  • examples for other OpenGL environment on native applications
  • 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)

Notes on OpenGL Environments

Supporting different OpenGL environments is not a trivial task, and it always have been a headache for a starter. We really want to make it as easy as possible for Go programmers. For a webapp in a browser, we use the experimental Go support (syscall/js) for WebAssembly. For a native app, we use go-gl's libraries such as gl & glfw. In order to deal with different versions of GLSL (OpenGL Shading Language), we have written all the shader codes in WebGL 1.0 (#version 100 es) as the default GLSL version, and convert the shader codes automatically into OpenGL 4.1 (#version 410) for OpenGL environments. Note that OpenGL 4.1 and OpenGL ES 2.0 and WebGL 1.0 are mostly compatible with each other.

Thanks

I hope this project can help many people to learn 2D & 3D graphics and to build awesome applications in Go.
Special thanks to the members of go-gl group and Richard Musiol, for their visions and so many contributions.
If you hava a feedback or suggestion, contact go4orward.

Resources taken from:

About

GIGL : Interactive 2D & 3D Graphics Library in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published