xgl2obj

Home

About Me
News
Contact Me


Work
My Resume
My Home Office

Client Testimonials

Play (& some work!)
JObjectTool

X-Plane
X-Plane Area 51

Personal
My Beloved Pupper Cody...

Opinions
Once You Go Mac...

Tips/Links
Mac OS X
WebMasters
Java (coming soon)

Important Update 03.04.11 - XGLTool changes

xgl2obj is a command-line (OSX terminal, Windows MS-DOS Prompt/Command Prompt) tool to convert XPXGL (.xpxgl) files to OBJv7 (.obj) text format. Note that this tool only creates OBJv7 files, usable by X-Plane v7+.

I will probably be incorporating this into XGLTool and/or renaming XGLTool in the near future. Until then, you'll have to use the terminal, etc.

X-Plane 7 is here!, and for modelers able to use XGLTool, we now have a way to convert your xpxgl objects to OBJv7 text format so you can then place them with WorldMaker.

The above shot from XPv7 shows Liberty and the Lexington Example converted to OBJv7 and placed at KSBD for easy viewing and debugging.

The tool is quite easy to use, but requires a certain folder structure - basically the tool needs to be in a folder/directory up one level from your model directories.

Here's my Mac OS X setup:

3dmodels
-xgl2obj
-liberty
--liberty.xpxgl
--liberty.bmp
-lexington_example
--lexington_example.xpxgl
--lexington_example.bmp

Meaning that xgl2obj sits in my 3dmodels folder. Inside that is a folder for each model (liberty and lexington_example here).

To use the tool, simply open a terminal window (OS X that's in Applications/Utilities/Terminal).

Then type "cd " (that's cd<space> with no quotes), switch to the finder, select your 3dmodels folder, then drag it to the terminal window.

This will place the full path to it in the terminal. You need to run this tool from your 3dmodels directory (or equivalent).

Switch to the terminal and press <return>. Then type "pwd<return>" (print working directory), and type "xgl2obj<return>".

You should then see something like this:

[tib800:~] dspotts% cd /v2/Users/dspotts/_3dmodels
[tib800:Users/dspotts/_3dmodels] dspotts% pwd
/v2/Users/dspotts/_3dmodels
[tib800:Users/dspotts/_3dmodels] dspotts% xgl2obj
xgl2obj, (c) 2002-2003 David Spotts, www.DSpotts.com built Apr  7 2003 at 19:46:30

Usage: xgl2obj [-h] infile.xpxgl  

[tib800:Users/dspotts/_3dmodels] dspotts% 

You are now in the right directory to use xgl2obj.

Using it is very simple:

[tib800:Users/dspotts/_3dmodels] dspotts% xgl2obj liberty/liberty.xpxgl
xgl2obj, (c) 2002-2003 David Spotts, www.DSpotts.com built Apr  7 2003 at 19:46:30

Using file liberty/liberty.xpxgl

Output file is liberty/liberty.obj
Opening output file for writing

Starting parse of liberty/liberty.xpxgl
XGL_VERSION=5
XGL_BOUNDING_BOX=[252.750000][48.194931][211.000000]
sNumTextures=1
texture[0]=liberty.png
XGL_SHAPE_HINT_TOKEN
HintData=0x1
HH hint = 1, data = 1

Elapsed time: 790.000000 ms

The above converted liberty/liberty.xpxgl to liberty/liberty.obj, which you can then place with WorldMaker (be sure you put the associated bitmap, liberty.bmp, libertyLIT.bmp in this case) in the right place in X-Plane.

Known Issues (working with Anthony/Austin on these)

  • Smoke is not yet supported and quads with textures named smoke1_xxx.bmp, smoke2_xxx.bmp will be output as regular quads

  • Hard surfaces are supported (quads with texture names like hard_xxx.bmp). We have verified this by landing on the lexington's flight deck.

  • Lights are output (light_NN_NN_NN.bmp, etc.), but do not appear to be working in XP (even the KSBD example)

  • Materials are not supported at all - This means you currently must apply textures to every polygon, otherwise it will not be displayed, as you can see from the "hole" in the Lexington and the missing antenna and radome

  • We do not yet have support for Austin's new shade_flat/shade_smooth primitives. I suspect we will introduce a new texture naming convention such that any texture that has "_smooth_" in it's name will have the shapes it is applied to "bracketed" by shade_smooth (enable smooth shading), and shade_flat (disable smooth shading)

Mac Download:

http://dspotts.com/downloads/030408_xgl2obj_mac.sit

Windows Download:

http://dspotts.com/downloads/030408_xgl2obj_win.zip

Windows Users:

You need to use either MS-DOS prompt (Win9x), or Command Prompt (Win2K+) to use this tool. You can find this in Programs/Accessories...

It requires the same directory structure as above (the tool goes one directory up from the actual model directory)..

You may want to create a directory like "c:\models", and place the tool (xgl2obj.exe) and your model folder(s) in there. Then, at the command prompt, type cd \models <return>

Then subsitute a backslash "\" for the forward slash on Mac OS X...

So to convert liberty, you use a command like this:

xgl2obj liberty\liberty.xpxgl

This then creates:

liberty\liberty.obj

I have tested the tool on my Win98 system and the output shows up in X-Planev7 just like the version created on the Mac.





Copyright © 1997-2004 David Spotts,
DSpotts.com and Clik2.com, All Rights Reserved

Site Footer Last Modified February 18, 2004
Comments?, Errors?, Omissions?

Site designed for 800x600+ Resolution
DSL/Cable Connection Recommended
Safari Recommended
Portions may require Internet Explorer, JAVA

Images, Servicemarks or Trademarks used on this site
are the property of their respective
owners and do not imply endorsement.

official paypal seal