Skip to content

Commit

Permalink
Merge pull request #1 from muonlineph/webserver
Browse files Browse the repository at this point in the history
update to threejs r114
  • Loading branch information
weaponsforge authored Mar 22, 2020
2 parents 68eb1d2 + a60a5c4 commit df5dbcf
Show file tree
Hide file tree
Showing 63 changed files with 7,008 additions and 1,099 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
56 changes: 47 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
# webgl-jsonloader

> Three.js model loader for **.obj** (JSON) files.
> - Backup of the original 2012 **jsonloader_v.1.0.1.zip** project files.
> - Warning: Not compatible with modern WebGL standards as of 2019 (?)
### 20120130 Change Logs
- adapted from three.js json loader sample (webgl_loader_json_blender.html)
- used three.js max exporter (2011); input:obj, output:js
- models from mu online
- notes: obj-converter (convert\_obj\_three.py) and blender plugin are also ok
> Three.js model loader for 3d object (**.obj**) files.

### Prerequisites

1. NodeJS
- node version 10.16.3
- npm version 6.9.0
2. Windows OS 64 bit
3. Web browser
- Chrome version 80.0.3987.149 (Official Build) (64-bit)
4. Three.js
- version r114


## Installation

1. Clone this repository.
`https://github.com/muonlineph/webgl-jsonloader.git`

2. Install dependencies.
`npm install`

3. Run the local web server.
`npm run start`

4. Load the webgl json loader from
`http://localhost:3000`



## Usage

1. Initialize a ThreeJS scene, camera and renderer. See `public/main.js` **init()** for more information.
2. Load ojbect model file(s) (.obj) and add to the ThreeJS scene.

let staff = await loadModel('objects/staffofkundun/', 'kundun-OBJ.mtl', 'kundun-OBJ.obj', {
position: { y:10 },
rotation: { x:-Math.PI/2, y:-Math.PI/3*2, z:-Math.PI/2 }
})

scene.add(staff)

- see `public/loader.js` for more loading options
- any number of object files can be loaded and added to the `scene`.



@weaponsforge
20200101
204 changes: 0 additions & 204 deletions index.html

This file was deleted.

9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const express = require('express')
const PORT = process.env.PORT || 3000
const app = express()

app.use(express.static('public'))

app.listen(PORT, () => {
console.log(`listening on http://localhost:${PORT}`)
})
22 changes: 0 additions & 22 deletions js/RequestAnimationFrame.js

This file was deleted.

8 changes: 0 additions & 8 deletions js/Stats.js

This file was deleted.

Loading

0 comments on commit df5dbcf

Please sign in to comment.