-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert-mesh
58 lines (40 loc) · 1.73 KB
/
convert-mesh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Creating Meshes for Omega
-------------------------
# Meshes #
Omega renderes entities with webgl via three.js which
uses its own json format for meshes.
An exporter plugin for blender is provided here:
https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender
On Fedora I placed this in the ~/.config/blender/2.64/ directory
The Vegastrike game ships a bunch of freely available meshes and textures
which may be imported into blender and converted to the three.js format.
On Fedora I downloaded these via yum:
# yum install vegastrike-data
The meshes are bxfm files located in the /usr/share/vegastrike dir
To convert:
- copy locally (important!!!)
- run: /usr/libexec/vegastrike/mesher ./foo.bxfm foo.obj boc
where foo.bxfm is the mesh you copied and foo.obj is the destination
obj file to write
- open blender and file > import foo.obj
- save the blender project
- file > export into three.js format (requires plugin above)
# Textures #
Vegastrike textures are in the 'dds' format (even though they
have a png extension)
Simply copy the file locally to foo.dds and run
$ convert foo.dds foo.png
This also works for cube-based texture sets:
$ convert foo.cube foo.png
# Compressed Textures #
three.js now has support for compressed textures so dds files:
https://github.com/mrdoob/three.js/issues/2348
The latest development version of ImageMagick has
support to convert png files into dds files as well:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=23946&start=15#p102574
# Using #
Edit which meshes and textures are used in
site/source/javascripts/omega/config.js
# TODO #
- Direct blender BFXM import script based on:
https://svn.code.sf.net/p/vegastrike/code/trunk/vegastrike/objconv/mesher/from_BFXM.cpp