GitXplorerGitXplorer
b

FeatherGL

public
11 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
5091f5fa9d416ab680ff4d0a809b189d2f408ecc

Updated Readme

bbnason committed 13 years ago
Unverified
2531af9eac7ea84f9fb8742f789cb4c8cf6fae36

Initial commit

bbnason committed 13 years ago

README

The README file for this repository.

Introduction

FeatherGL is a lightweight open source JavaScript library for managing a WebGL environment.

Examples

Download

Use

view = new Feather.View(new Feather.WebGL(canvas[0]));

// Create the Vertex Array
var vertices = 
    [
        [0, 0, 0], 
        [1, 0, 0],
        [-Math.cos(Math.PI*2/3), Math.sin(Math.PI*2/3), 0],
    ];
// Create the Vertex Index Array
var vertexIndexArray = [ 0, 1, 2 ];

// Create the Normals Array
var normals =
    [
        [0, 0, -1],
        [0, 0, -1],
        [0, 0, -1],
    ];

// Construct an RGBA color
var colors =
    [
        [1.0, 0.0, 0.0, 1.0],
        [0.0, 1.0, 0.0, 1.0],
        [0.0, 0.0, 1.0, 1.0],
    ];

//* Create and initialize a new mesh object
var triangle = new Feather.Mesh(vertices, vertexIndexArray, normals, colors, Feather.MESH_TRIANGLE_STRIP);

// Center the triangle
triangle.translateX(-0.5);
triangle.translateY(-0.5);

// Add square mesh to scene
view.scene.addMesh(triangle);

//* Draw the scene
view.update();