Skip to content

Commit

Permalink
added README
Browse files Browse the repository at this point in the history
  • Loading branch information
sohamkamani committed Dec 19, 2015
1 parent bc1f60f commit 7f1e23f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# three-object-loader [![Build Status](https://travis-ci.org/sohamkamani/three-object-loader.svg?branch=master)](https://travis-ci.org/sohamkamani/three-object-loader) [![Coverage Status](https://coveralls.io/repos/sohamkamani/three-object-loader/badge.svg?branch=master&service=github)](https://coveralls.io/github/sohamkamani/three-object-loader?branch=master)

> My node module
> NodeJS wrapper for Three.js' OBJLoader function
By default, Three.js does not have OBJLoader built in. This is a NodeJS wrapper for the OBJLoader library so that it can be used with npm in systems using browserify, webpack, etc.

## Install

```
$ npm install --save three-object-loader
$ npm install --save three-obj-loader
```

## Usage

```js
var THREE = require('three');
var OBJLoader = require('three-obj-loader');
OBJLoader(THREE);

console.log(typeof THREE.OBJLoader);
//=> 'function'
```

## License
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "three-object-loader",
"name": "three-obj-loader",
"version": "0.1.0",
"description": "My node module",
"description": "NodeJS wrapper for Three.js' OBJLoader function",
"main": "dist/index.js",
"scripts": {
"test": "gulp test"
Expand Down
12 changes: 12 additions & 0 deletions source/sample.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
26 changes: 26 additions & 0 deletions source/sample.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Blender v2.76 (sub 0) OBJ File: ''
# www.blender.org
mtllib sample.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 1.000000 0.000000 0.000000
vn -0.000000 -0.000000 1.000000
vn -1.000000 -0.000000 -0.000000
vn 0.000000 0.000000 -1.000000
usemtl Material
s off
f 1//1 2//1 3//1 4//1
f 5//2 8//2 7//2 6//2
f 1//3 5//3 6//3 2//3
f 2//4 6//4 7//4 3//4
f 3//5 7//5 8//5 4//5
f 5//6 1//6 4//6 8//6
6 changes: 6 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ describe('OBJLoader Wrapper', ()=>{
OBJLoader(THREE);
expect(THREE.OBJLoader).to.be.a('function');
});

it('Is an instance of ObjectLoader', ()=>{
const loader = new THREE.OBJLoader();
expect(loader).to.be.an.instanceof(THREE.OBJLoader);
});

});

0 comments on commit 7f1e23f

Please sign in to comment.