An open API service indexing awesome lists of open source software.

https://github.com/waldyrious/minimal-webgl

The absolute minimal code to get a WebGL canvas showing something
https://github.com/waldyrious/minimal-webgl

Last synced: 4 months ago
JSON representation

The absolute minimal code to get a WebGL canvas showing something

Awesome Lists containing this project

README

          

# Minimal WebGL

The minimal code to get a WebGL canvas showing a simple object.
Most defaults are left alone
(perspective is orthographic, no transformations applied, etc.)
to make the code as approachable as possible.
A single square is shown, at the center of the canvas.
The `vertices` array can be changed to show a different shape,
and the `color` array edited to change the object's color.

This code was heavily inspired by [@guciek](https://github.com/guciek)'s
[Shortest WebGL example](https://sites.google.com/site/progyumming/javascript/shortest-webgl),
but aims to be a fully documented such example
(using [Docco](http://jashkenas.github.io/docco/),
[groc](https://github.com/nevir/groc) or
[this simple script](http://jsfiddle.net/D2nm4/12/)),
rather than just the code.
See [Issue #2](https://github.com/waldyrious/minimal-webgl/issues/2)
for the plans to actually implement the inline documentation view.