As stated in the introduction, OBJ2MAP is a command-line application. It uses the self-contained Metrowerks SIOUX library so you don't have to mess with MacOSX's terminal or do anything special to get it running - just double click and you're off.
Before you do that however, you'll need to create an OBJ file. Many 3D modelling applications support OBJ export (sometimes referred to as "Wavefront" format), but support comes in varying degrees. OBJ2MAP will only convert polygons (triangles, quads or n-sided), it will ignore all beizer or nurbs info that may be present in the OBJ file. Most 3D packages will tessellate native nurbs or patches into polygons when exporting, so it may not be necessary to do this manually (check your 3D application's documentation to see if this is the case). OBJ2MAP will convert each mesh group in the OBJ file separately, using keywords entered in the mesh group's name to choose a conversion format. OBJ2MAP keywords start with an underscore "_", followed by three uppercase letters, and closed with another underscore. i.e. _NEX_ triggers a Normal Extrusion. The keyword can be placed anywhere in the mesh group's name, but only one keyword per group is allowed. Each conversion mode uses a default "offset" value to control the extrusion thickness or distance (depending on the conversion type). This value can be overridden on a per-mesh basis by extending the keyword with an offset amount. i.e. Adding _NEX32_ to a mesh group's name will extrude the geometry 32 units instead of the default 16 (or whatever is specified in the commandline). It's best to use multiples of 8 for most offsets, but there are times when tweaking an offset by 1 unit will counter rounding errors. Note that only Heightmap extrusions can accept a value of zero or less, all other extrusions will issue a warning and use the default value if their offset is set below 1. (Place a dash in front of the offset for negative values. i.e. _HFC-64_)
There are some things you need to keep in mind when naming mesh groups; 3D applications often allow any characters to be used as a mesh name, but the OBJ format only allows alphanumeric characters plus underscore, dash, and dollar sign. Illegal characters will likely be replaced with an underscore when exporting the OBJ file. It is also possible to have multiple mesh groups with identical names in some 3D modelers, but this is not allowed in the OBJ format. In this case, many applications will append a sequence of digits to the end of duplicate names when exporting in the OBJ format. Names may be truncated if they're too long, or extraneous trailing digits may even be dropped. In short: Keep your mesh names unique, use only alpha-numeric characters, and it's a good idea to add OBJ2MAP keywords at the beginning of the name just in case it becomes truncated when exported.
OBJ2MAP isn't strict on the presence of the trailing underscore on name flags, but it provides a safety buffer that will prevent problems if mesh groups are renamed when saving. The preceding underscore is required.
Once you have an OBJ model to work with, place it in the same folder as the OBJ2MAP application. Double-click OBJ2MAP and you'll be presented with a dialog. In the text field (command line), enter the name of your OBJ file and click "OK". Note that you don't need to type the ".obj" extension, but the actual file must have the extension. OBJ2MAP will take a few seconds and either convert the file, or print an error. If it's successful, you'll have a ".map" file in the same directory and with the same name as your OBJ file ready to import into Quiver.
|
You can control OBJ2MAP's global options via the SIOUX command line. The command line must be formated in this fashion: [options] sourcefile [destfile] - Items inside the brackets are optional.
sourcefile is the name of an OBJ file you've prepared. It's simplest to place the OBJ file into the same directory as OBJ2MAP, but OBJ2MAP will traverse directories if required. OBJ2MAP's cross platform and ANSI C underpinnings means it uses DOS style paths. i.e. maps/myobj will point to an OBJ file called myobj.obj in a folder called maps that resides in the same folder as OBJ2MAP - this is totally valid but usually not worth the effort.
destfile is the name of the MAP file OBJ2MAP will output. The default is to use the same name as the input OBJ file, and just change the file extension to ".map".
options can consist of any combination of the switches below, separated by spaces:
-nogroup
Puts all brushes into the worldspawn entity. Default behaviour is to group all face mode and heightmap mode brushes into am_detail entities.
-verbose
Tells OBJ2MAP to output detailed information during the conversion process. Useful for debugging bad brushes.
-usefloats
OBJ2MAP quantizes geometry to a 1x1 grid (input and output) by default to maintain compatibility with Quiver and to avoid common mapping pitfalls like clipping errors. -usefloats disables this quantizing and saves the brush planes with floating-point precision. This is usually a bad idea, but the functionality exists nonetheless.
-rotX n -rotY n -rotZ n
Rotates the input model around the specified axis by n degrees. The default puts Z going up (-rotX 90 -rotY 0 -rotZ 0) as this is what Quake expects. Some modeling applications may require a different orientation. (NOTE: Converted geometry can be adversely affected if incorrect values are used here)
-foffset n
Changes the default offset amount to n for Face Mode conversions.
-hoffset n
Changes the default offset amount to n for Height Map Extrusions.
-aoffset n
Changes the default offset amount to n for Axial Extrusions.
-noffset n
Changes the default offset amount to n for Normal Extrusions.
|
|