1 | ## convert-to-threejs
|
---|
2 |
|
---|
3 | Utility for converting model files to the Three.js JSON format
|
---|
4 |
|
---|
5 | ## Supported Formats
|
---|
6 |
|
---|
7 | * Fbx (.fbx) (versions 7.3, 7.2, 7.1, 7.0, 6.1, and 6.0) (non-binary)
|
---|
8 | * Collada (.dae) (1.5 and earlier)
|
---|
9 | * Wavefront/Alias (.obj)
|
---|
10 | * 3D Studio Max (.3ds)
|
---|
11 |
|
---|
12 | ## Usage
|
---|
13 |
|
---|
14 | ```
|
---|
15 | convert_to_threejs.py [source_file] [output_file] [options]
|
---|
16 |
|
---|
17 | Options:
|
---|
18 | -t, --triangulate force quad geometry into triangles
|
---|
19 | -p, --prefix prefix object names in the output file
|
---|
20 | -g, --geometry-only output geometry only
|
---|
21 | -c, --default-camera include a default camera in the output scene
|
---|
22 | -l, --defualt-light include a default light in the output scene
|
---|
23 | -x, --no-textures don't include texture references in the output file
|
---|
24 | ```
|
---|
25 |
|
---|
26 | ## Supported Features
|
---|
27 |
|
---|
28 | * Object Hierarchies
|
---|
29 | * Lights (Ambient, Point, Directional)
|
---|
30 | * Cameras (Perspective, Ortho)
|
---|
31 | * Geometries (Triangles, Quads, Nurbs)
|
---|
32 | * Materials (Phong, Lambert)
|
---|
33 | * Textures (Diffuse, Emissive, Ambient, Specular, Normal, Bump)
|
---|
34 | * Multiple UV layers
|
---|
35 | * Multiple materials per mesh
|
---|
36 |
|
---|
37 | ## Current Limitations
|
---|
38 |
|
---|
39 | * No animation support
|
---|
40 | * Only Lambert and Phong materials are supported
|
---|
41 | * Some camera properties are not converted correctly
|
---|
42 | * Some light properties are not converted correctly
|
---|
43 | * Some material properties are not converted correctly
|
---|
44 |
|
---|
45 | ## Dependencies
|
---|
46 |
|
---|
47 | ### FBX SDK
|
---|
48 | * Requires Autodesk FBX SDK Python 2013.3 bindings.
|
---|
49 |
|
---|
50 | ```
|
---|
51 | You can download the python bindings from the Autodesk website:
|
---|
52 | http://usa.autodesk.com/fbx/
|
---|
53 | ```
|
---|
54 |
|
---|
55 | ```
|
---|
56 | Don't forget the visit the FBX SDK documentation website:
|
---|
57 | http://docs.autodesk.com/FBX/2013/ENU/FBX-SDK-Documentation/cpp_ref/index.html
|
---|
58 | ```
|
---|
59 |
|
---|
60 | ### Python
|
---|
61 | * Requires Python 2.6 or 3.1 (The FBX SDK requires one of these versions)
|
---|
62 |
|
---|
63 | ``` bash
|
---|
64 | sudo apt-get install build-essential
|
---|
65 | wget http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tar.bz2
|
---|
66 | tar jxf ./Python-2.6.8.tar.bz2
|
---|
67 | cd ./Python-2.6.8
|
---|
68 | ./configure --prefix=/opt/python2.6.8 && make && make install
|
---|
69 | ```
|
---|