├── LICENSE
├── README.md
├── assets
├── environment
│ ├── Bridge2
│ │ ├── README.md
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ └── posz.jpg
│ ├── FootprintCourt
│ │ ├── negx.hdr
│ │ ├── negy.hdr
│ │ ├── negz.hdr
│ │ ├── posx.hdr
│ │ ├── posy.hdr
│ │ └── posz.hdr
│ ├── Park2
│ │ ├── README.md
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ └── posz.jpg
│ ├── Park3Med
│ │ ├── README.md
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ └── posz.jpg
│ ├── SwedishRoyalCastle
│ │ ├── README.md
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ └── posz.jpg
│ ├── index.js
│ └── skybox
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ └── posz.jpg
├── favicon.ico
├── github@1X.png
├── github@2X.png
└── icons
│ ├── fbx-Viewer.icns
│ ├── fbx-Viewer.ico
│ └── fbx-Viewer.png
├── electron
└── main.js
├── index.html
├── lib
├── WebGL.js
├── inflate.min.js
└── stats.min.js
├── package.json
├── scripts
└── gen_test.js
├── src
├── app.js
└── viewer.js
└── style.css
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Pavel Kuznetsov
4 | Copyright (c) 2017 Don McCurdy
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # three-fbx-viewer
2 | Drag-and-drop preview for FBX models in WebGL using three.js.
3 |
4 | Demo https://limitless.pro/three-fbx-viewer
5 |
6 | 
7 | ## Quickstart
8 |
9 | ### Web
10 |
11 | ```
12 | npm install
13 | npm run dev
14 | ```
15 |
16 | ### Desktop (Electron)
17 |
18 | To build the desktop application, run:
19 |
20 | ```shell
21 | # development build
22 | npm run dev:electron
23 |
24 | # package for release
25 | npm run package
26 | ```
27 |
--------------------------------------------------------------------------------
/assets/environment/Bridge2/README.md:
--------------------------------------------------------------------------------
1 | Author
2 | ======
3 |
4 | This is the work of Emil Persson, aka Humus.
5 | http://www.humus.name
6 | humus@comhem.se
7 |
8 |
9 |
10 | Legal stuff
11 | ===========
12 |
13 | This work is free and may be used by anyone for any purpose
14 | and may be distributed freely to anyone using any distribution
15 | media or distribution method as long as this file is included.
16 | Distribution without this file is allowed if it's distributed
17 | with free non-commercial software; however, fair credit of the
18 | original author is expected.
19 | Any commercial distribution of this software requires the written
20 | approval of Emil Persson.
21 |
--------------------------------------------------------------------------------
/assets/environment/Bridge2/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/negx.jpg
--------------------------------------------------------------------------------
/assets/environment/Bridge2/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/negy.jpg
--------------------------------------------------------------------------------
/assets/environment/Bridge2/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/negz.jpg
--------------------------------------------------------------------------------
/assets/environment/Bridge2/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/posx.jpg
--------------------------------------------------------------------------------
/assets/environment/Bridge2/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/posy.jpg
--------------------------------------------------------------------------------
/assets/environment/Bridge2/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Bridge2/posz.jpg
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/negx.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/negx.hdr
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/negy.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/negy.hdr
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/negz.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/negz.hdr
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/posx.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/posx.hdr
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/posy.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/posy.hdr
--------------------------------------------------------------------------------
/assets/environment/FootprintCourt/posz.hdr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/FootprintCourt/posz.hdr
--------------------------------------------------------------------------------
/assets/environment/Park2/README.md:
--------------------------------------------------------------------------------
1 | Author
2 | ======
3 |
4 | This is the work of Emil Persson, aka Humus.
5 | http://www.humus.name
6 | humus@comhem.se
7 |
8 |
9 |
10 | Legal stuff
11 | ===========
12 |
13 | This work is free and may be used by anyone for any purpose
14 | and may be distributed freely to anyone using any distribution
15 | media or distribution method as long as this file is included.
16 | Distribution without this file is allowed if it's distributed
17 | with free non-commercial software; however, fair credit of the
18 | original author is expected.
19 | Any commercial distribution of this software requires the written
20 | approval of Emil Persson.
21 |
--------------------------------------------------------------------------------
/assets/environment/Park2/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/negx.jpg
--------------------------------------------------------------------------------
/assets/environment/Park2/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/negy.jpg
--------------------------------------------------------------------------------
/assets/environment/Park2/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/negz.jpg
--------------------------------------------------------------------------------
/assets/environment/Park2/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/posx.jpg
--------------------------------------------------------------------------------
/assets/environment/Park2/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/posy.jpg
--------------------------------------------------------------------------------
/assets/environment/Park2/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park2/posz.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/README.md:
--------------------------------------------------------------------------------
1 | Author
2 | ======
3 |
4 | This is the work of Emil Persson, aka Humus.
5 | http://www.humus.name
6 | humus@comhem.se
7 |
8 |
9 |
10 | Legal stuff
11 | ===========
12 |
13 | This work is free and may be used by anyone for any purpose
14 | and may be distributed freely to anyone using any distribution
15 | media or distribution method as long as this file is included.
16 | Distribution without this file is allowed if it's distributed
17 | with free non-commercial software; however, fair credit of the
18 | original author is expected.
19 | Any commercial distribution of this software requires the written
20 | approval of Emil Persson.
21 |
--------------------------------------------------------------------------------
/assets/environment/Park3Med/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/negx.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/negy.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/negz.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/posx.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/posy.jpg
--------------------------------------------------------------------------------
/assets/environment/Park3Med/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/Park3Med/posz.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/README.md:
--------------------------------------------------------------------------------
1 | Author
2 | ======
3 |
4 | This is the work of Emil Persson, aka Humus.
5 | http://www.humus.name
6 | humus@comhem.se
7 |
8 |
9 |
10 | Legal stuff
11 | ===========
12 |
13 | This work is free and may be used by anyone for any purpose
14 | and may be distributed freely to anyone using any distribution
15 | media or distribution method as long as this file is included.
16 | Distribution without this file is allowed if it's distributed
17 | with free non-commercial software; however, fair credit of the
18 | original author is expected.
19 | Any commercial distribution of this software requires the written
20 | approval of Emil Persson.
21 |
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/negx.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/negy.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/negz.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/posx.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/posy.jpg
--------------------------------------------------------------------------------
/assets/environment/SwedishRoyalCastle/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/SwedishRoyalCastle/posz.jpg
--------------------------------------------------------------------------------
/assets/environment/index.js:
--------------------------------------------------------------------------------
1 | module.exports = [
2 | {
3 | name: 'None',
4 | path: null,
5 | format: '.jpg'
6 | },
7 | {
8 | name: 'Park (Day)',
9 | path: 'assets/environment/Park2/',
10 | format: '.jpg'
11 | },
12 | {
13 | name: 'Park (Night)',
14 | path: 'assets/environment/Park3Med/',
15 | format: '.jpg'
16 | },
17 | {
18 | name: 'Bridge',
19 | path: 'assets/environment/Bridge2/',
20 | format: '.jpg'
21 | },
22 | {
23 | name: 'Sky',
24 | path: 'assets/environment/skybox/',
25 | format: '.jpg'
26 | },
27 | {
28 | name: 'Castle',
29 | path: 'assets/environment/SwedishRoyalCastle/',
30 | format: '.jpg'
31 | },
32 | {
33 | name: 'Footprint Court (HDR)',
34 | path: 'assets/environment/FootprintCourt/',
35 | format: '.hdr'
36 | }
37 | ];
38 |
--------------------------------------------------------------------------------
/assets/environment/skybox/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/negx.jpg
--------------------------------------------------------------------------------
/assets/environment/skybox/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/negy.jpg
--------------------------------------------------------------------------------
/assets/environment/skybox/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/negz.jpg
--------------------------------------------------------------------------------
/assets/environment/skybox/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/posx.jpg
--------------------------------------------------------------------------------
/assets/environment/skybox/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/posy.jpg
--------------------------------------------------------------------------------
/assets/environment/skybox/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/environment/skybox/posz.jpg
--------------------------------------------------------------------------------
/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/favicon.ico
--------------------------------------------------------------------------------
/assets/github@1X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/github@1X.png
--------------------------------------------------------------------------------
/assets/github@2X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/github@2X.png
--------------------------------------------------------------------------------
/assets/icons/fbx-Viewer.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/icons/fbx-Viewer.icns
--------------------------------------------------------------------------------
/assets/icons/fbx-Viewer.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/icons/fbx-Viewer.ico
--------------------------------------------------------------------------------
/assets/icons/fbx-Viewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/limitlesspro/three-fbx-viewer/299a8d6ca79cb358f83f828d384771bac315029c/assets/icons/fbx-Viewer.png
--------------------------------------------------------------------------------
/electron/main.js:
--------------------------------------------------------------------------------
1 | const { app, BrowserWindow } = require('electron');
2 | const url = require('url');
3 | const path = require('path');
4 | const open = require('open');
5 |
6 | // Keep a global reference of the window object, if you don't, the window will
7 | // be closed automatically when the JavaScript object is garbage collected.
8 | let win;
9 |
10 | function createWindow () {
11 | // Create the browser window.
12 | win = new BrowserWindow({width: 800, height: 600});
13 |
14 | // and load the index.html of the app.
15 | win.loadURL(url.format({
16 | pathname: path.join(__dirname, '../index.html'),
17 | protocol: 'file:',
18 | slashes: true
19 | }));
20 |
21 | // Open the DevTools.
22 | // win.webContents.openDevTools();
23 |
24 | win.webContents.on('new-window', function(event, url){
25 | event.preventDefault();
26 | open(url);
27 | });
28 |
29 | // Emitted when the window is closed.
30 | win.on('closed', () => {
31 | // Dereference the window object, usually you would store windows
32 | // in an array if your app supports multi windows, this is the time
33 | // when you should delete the corresponding element.
34 | win = null;
35 | });
36 | }
37 |
38 | // This method will be called when Electron has finished
39 | // initialization and is ready to create browser windows.
40 | // Some APIs can only be used after this event occurs.
41 | app.on('ready', createWindow);
42 |
43 | // Quit when all windows are closed.
44 | app.on('window-all-closed', () => {
45 | // On macOS it is common for applications and their menu bar
46 | // to stay active until the user quits explicitly with Cmd + Q
47 | if (process.platform !== 'darwin') {
48 | app.quit();
49 | }
50 | });
51 |
52 | app.on('activate', () => {
53 | // On macOS it's common to re-create a window in the app when the
54 | // dock icon is clicked and there are no other windows open.
55 | if (win === null) {
56 | createWindow();
57 | }
58 | });
59 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |