-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from muonlineph/webserver
update to threejs r114
- Loading branch information
Showing
63 changed files
with
7,008 additions
and
1,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.