Code Monkey home page Code Monkey logo

gaf.js's Introduction

WebGL Application Framework

Synopsis

gaf.js is a minimal WebGL application framework (ES6) that is composed of an App class that helps create an environment like Processing, Openframeworks, Cinder so you can just override the setup and draw methods and get going without having to care too much about the HTML canvas or setting up a valid WebGL context or setting up a draw loop via requestAnimationFrame (which is used inside of gaf.js)

Code Example

The library contains one key class that is meant to be overridden like so:

import App from 'gaf';

class MyApp extends App {
  constructor( props ) {
    super( props );
    // runs before setup   
  }
  setup  = () => { /* setup app  */ };
  update = () => { /* update app */ };
  render = () => { /* render app */ };    
};

To get your application running, create a new instance:

// continuing from the example above
var myApp;
if( myApp == undefined ) {
  myApp = new myApp();
}

If you need to get access to the WebGL context or HTML canvas:

// continuing from the example above
var gl = myApp.getContext();
var canvas = myApp.getCanvas();

Motivation

This library is part of a larger project / series of libraries that aspires to bring computational and parametric design applications to the web. This library aspires to provide a flexible & modular internal app framework to help power all types of web apps dealing with computational design, 3d printing, g-code generation, cnc milling tool path creation, laser cutting paths, robotic motion planning, and more.

Build Requirements

node.js (4.4.0+) & npm

gaf.js is built for ES6 so be sure to transpile to ES5 if your browser / server doesn't support ES5, here is how I do it:

"browserify": {
  "transform": [ [ "babelify", { "presets": [ "es2015", "stage-0" ] } ] ]
}

Installation

You can add this library to your project by running:

npm install --save https://github.com/YCAMInterlab/gaf.js.git

or via npm:

npm install --save gaf

Contribution

Copyright 2015-2016 Reza Ali co-developed by YCAMInterLab during the Guest Research Project v.3

License

Apache-2.0

gaf.js's People

Contributors

rezaali avatar konnokeina avatar

Stargazers

Rob Sawyer avatar RJ Duran avatar 子龙 avatar Lukas Hermann avatar  avatar  avatar Mike Edwards avatar AKA avatar  avatar Marshall Jones avatar mactkg avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.