├── .gitignore ├── .npmignore ├── demo.js ├── README.md ├── src └── old │ └── vec3-rotate.js ├── LICENSE.md └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | *.log 4 | .DS_Store 5 | bundle.js 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | *.log 4 | .DS_Store 5 | bundle.js 6 | test 7 | test.js 8 | demo/ 9 | .npmignore 10 | LICENSE.md -------------------------------------------------------------------------------- /demo.js: -------------------------------------------------------------------------------- 1 | const gl = require('webgl-context')() 2 | const canvas = gl.canvas 3 | 4 | const app = require('canvas-loop')(canvas, { 5 | scale: window.devicePixelRatio 6 | }) 7 | 8 | app.on('tick', render).start() 9 | 10 | function render(dt) { 11 | 12 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # glo 2 | 3 | [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges) 4 | 5 | this is just experiments, nothing yet. 6 | 7 | keep an eye on this org: 8 | 9 | https://github.com/glo-js/ 10 | 11 | ## Usage 12 | 13 | [![NPM](https://nodei.co/npm/glo.png)](https://www.npmjs.com/package/glo) 14 | 15 | ## License 16 | 17 | MIT, see [LICENSE.md](http://github.com/mattdesl/glo/blob/master/LICENSE.md) for details. 18 | -------------------------------------------------------------------------------- /src/old/vec3-rotate.js: -------------------------------------------------------------------------------- 1 | var fromQuat = require('gl-mat4/fromQuat') 2 | var identity4x4 = require('gl-mat4/identity') 3 | var setAxisAngle = require('gl-quat/setAxisAngle') 4 | var transformMat4 = require('gl-vec3/transformMat4') 5 | var setVec4 = require('gl-vec4/set') 6 | 7 | var tmpMat4 = identity4x4([]) 8 | var tmpQuat = [0, 0, 0, 1] 9 | var tmpVec4 = [0, 0, 0, 0] 10 | 11 | module.exports = rotate 12 | 13 | function rotate (out, vec, axis, radians) { 14 | setAxisAngle(tmpQuat, axis, radians) 15 | fromQuat(tmpMat4, tmpQuat) 16 | return transformMat4(out, vec, tmpMat4) 17 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015 Matt DesLauriers 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 20 | OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "glo", 3 | "version": "1.0.1", 4 | "description": "experimental WebGL2 framework", 5 | "main": "index.js", 6 | "license": "MIT", 7 | "private": true, 8 | "author": { 9 | "name": "Matt DesLauriers", 10 | "email": "dave.des@gmail.com", 11 | "url": "https://github.com/mattdesl" 12 | }, 13 | "dependencies": { 14 | "2d-context": "^1.2.0", 15 | "camera-project": "^1.0.1", 16 | "canvas-fit-loop": "^1.0.2", 17 | "defined": "^1.0.0", 18 | "draw-triangles-2d": "^1.0.0", 19 | "gl-mat4": "^1.1.3", 20 | "gl-quat": "^1.0.0", 21 | "gl-vec3": "^1.0.3", 22 | "gl-vec4": "^1.0.1", 23 | "object-assign": "^2.0.0" 24 | }, 25 | "devDependencies": { 26 | "babelify": "^6.1.0", 27 | "budo": "^4.0.0", 28 | "garnish": "^2.1.3", 29 | "installify": "^1.0.1" 30 | }, 31 | "scripts": { 32 | "test": "node test.js", 33 | "start-2d": "budo demo-2d.js:bundle.js --live --verbose -- -t babelify -t [ installify --save ] | garnish", 34 | "start": "budo demo.js:bundle.js --live --verbose -- -t babelify -t [ installify --save ] | garnish" 35 | }, 36 | "keywords": [], 37 | "repository": { 38 | "type": "git", 39 | "url": "git://github.com/mattdesl/glo.git" 40 | }, 41 | "homepage": "https://github.com/mattdesl/glo", 42 | "bugs": { 43 | "url": "https://github.com/mattdesl/glo/issues" 44 | } 45 | } 46 | --------------------------------------------------------------------------------