home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Windows 95.com 1996 September
/
WIN95_09962.iso
/
vrml
/
dm2v-10.zip
/
README.TXT
< prev
Wrap
Text File
|
1996-06-24
|
10KB
|
224 lines
doomToVrml2 (a.k.a. Doom2VRML), Kenneth B. Russell
Doom to VRML 2.0 Converter. kbrussel@engr.sgi.com
Version 1.0 (kbrussel@media.mit.edu
June 24, 1996 after Aug 31, 1996)
***************************
Copyright (C) 1996 Silicon Graphics, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software (the "Software") to use
and modify the Software for personal use. The Software may
not be resold or licensed for a fee without Silicon
Graphics, Inc.'s ("SGI") prior written consent. The above
copyright notice and permission must be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT IS SGI LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OF THE SOFTWARE.
Except as contained in this notice and permission, SGI's
name may not be used in advertising or otherwise to promote
the use or other dealings of the Software without SGI's
prior written consent.
***************************
Contents
--------
i. Version History
I. What is Doom2VRML?
II. Improvements Over WadToIv
III. Using Doom2VRML
IV. Compiling and Porting Doom2VRML
V. Credits
VI. Known Problems
VII. For More Information
Section i. Version History
--------------------------
Version 1.0 - June 24, 1996
- First Public Release
Section I. What is Doom2VRML?
-----------------------------
Doom2VRML, as the name implies, is a utility which converts the
polygon and texture information in a Doom level into a VRML 2.0 world
file. The resulting file can be posted on the World Wide Web. In
short, it's "Doom on the Web".
Doom2VRML was based on WadToIv (see Section VII), by the same
author. All of the code has been rewritten, and several new functions
and improvements over WadToIv have been made. Most significantly,
Doom2VRML is cross-platform compatible; it runs on the PC and SGI, and
porting to other platforms should be straightforward (see Section IV,
below).
What is Doom2VRML good for? First, it allows users to author VRML 2.0
content using standard Doom editors. These programs, created by
dedicated authors, are arguably the best (and least expensive!) way to
create large, compelling environments to explore. Second, it provides
an immediate content infusion to the VRML community, by giving access
to the thousands of freely available Doom levels on the Internet.
Section II. Improvements Over WadToIv
-------------------------------------
Doom2VRML sports the following new features over WadToIv:
- New tesselation algorithm for floors and ceilings, using
Doom's BSP tree information. Sunken floors/raised ceilings
now appear properly in the output file.
- MOVING DOORS! Click to open; they close automatically.
- VIEWPOINTS! All player starts (including Deathmatch ones) are
converted into VRML 2.0 Viewpoints.
- Spatial organization of the scene graph; polygons are grouped
into rooms. Render culling should now work; improves
performance greatly on platforms which support this
functionality.
- Checks on polygons eliminate "coincident vertex" errors and
resulting slowdowns.
- Optional materials provide solid coloring for walls in
situations where texture mapping is too expensive.
- Both JPEG and IRIS RGB texture output formats supported.
- Dependency on Open Inventor eliminated for better
cross-platform compatibility.
Section III. Using Doom2VRML
----------------------------
Doom2VRML is run from the command line on both UNIX platforms and
PCs. Therefore, the PC version must be run from within DOS. The currently
available versions run under Irix 5.3 or above on SGI platforms and under
the DOS shell in Windows 95 on the PC.
Typing "doomToVrml2" (or "dm2vrml" in the PC version) prints a screen
describing the command line options. Again, they are:
doomToVrml2 [-2] [-f <WAD filename>] [-e <episode>]
[-m <mission>] [-a] [-t <texture mode>]
[-p <palette number>]
-2 turns on Doom 2 mode: mission can go from 1 to 32,
episode is ignored, and doomToVrml2 looks for doom2.wad
-f <WAD filename> specifies an optional patch wad
-a causes Material nodes to be Added to the outputted
VRML file. This adds background colors to the
polygons, but may slow down rendering.
-t <texture mode> changes the file format in which
textures will be outputted. Valid values are
JPEG and SGI; default is JPEG.
-p <palette number> changes which Doom palette is used
for wall and floor/ceiling textures; allows
outputting of "hurt" or "power-up" tinted
textures. NOTE that this option is NOT bounds
checked. Use at your own risk.
Episode and mission default to E1M1 (or MAP01 for Doom 2).
Doom2VRML does all its work in the current directory. This means it
looks in the current directory for the main WAD file (either doom.wad
or doom2.wad) and outputs all its files (lots of .jpg's, plus one .wrl
file) in the same place. To avoid making a mess of your hard drive,
you may want to make subdirectories for each Doom level you create. In
UNIX you can make symlinks to put references to the executable and
main WAD file in each of these subdirectories; under DOS you will have
to move files around.
The converted level, which appears as a world file (for example,
"e2m1.wrl" or "map03.wrl") can be viewed in any VRML 2.0-compliant
browser, such as SGI's Cosmo Player (see Section VII). The following
two aspects of the file are probably the most interesting:
- DOORS MOVE! Click on a door to open it, and it closes
automatically after a delay. Doors requiring keys should work.
- Player starts in the level appear as Viewpoints in the world
file. These viewpoints can be animated, or sufficiently many
can be added, to create a guided tour of the level.
Section IV. Compiling and Porting Doom2VRML
-------------------------------------------
The first thing you will need to do is obtain the Independent JPEG
Group's JPEG software, available from
ftp://ftp.uu.net/graphics/jpeg/. The version Doom2VRML uses is version
6a, but it should work with any later version as long as the API
hasn't changed too much. Create a subdirectory inside the Doom2VRML
directory called "jpeg-6a", uncompress the archive in this
subdirectory, and configure and compile the JPEG library.
Once this is done, you will need to configure the file "byteswap.h" for
your architecture. If you are running on a little-endian machine, add
a conditionalized #define LITTLE_ENDIAN to the top of byteswap.h; see
the current entry for Windows already present for an example.
If your sys/types.h does not predefine types such as uint16_t (you'll know
because the compile will fail inside sgiimage.cpp with a related error),
see the top of sgiimage.cpp and conditionally typedef those types to the
appropriate ones. uint16_t is an unsigned integer of 16 bits; uint32_t is
an unsigned integer of 32 bits.
If your compiler does not automatically find the code for templates
(as SGI's does), you may need to add a conditionalized #include at the
bottom of "growarray.h", as was necessary for Windows. This will
almost certainly be necessary for users of g++.
Finally, you will need to rewrite the Makefile so it does not depend
on SGI-specific makerules. Sorry.
Section V. Credits
------------------
Thanks go to:
- id Software for the game Doom
- Raphael Quinet and Brendan Wyber for DEU (the Doom Editing
Utilities), especially for distributing the source code (from
which I borrowed several WAD reading functions)
- David Frerichs for the initial door motion code
- The Independent JPEG Group for a wonderful library
- Matthew S. Fell for the Unofficial Doom Specs
- Scott Amspoker for TEXTURES.TXT, a terrific explanation of Doom
texture alignment
Doom is a trademark of id Software, inc.
Section VI. Known Problems
--------------------------
- The Cosmo Player implementation on the PC currently suffers from
limitations in RenderWare on the number of times a texture can be
repeated. Textures (especially floor and ceiling textures) may
appear "striped" as they are clamped to their last values beyond
this point.
- The PC version of Cosmo Player occasionally appears to stretch
certain textures vertically by about a factor of two. The same
textures appear fine on the SGI version.
- The code which detects the presence of doors is not very robust (yet?),
and fails for certain types of Doom doors (i.e. those which only open
on one side). This can cause missing polygons where those doors should
be, as well as doors which do not open.
Section VII. For More Information
---------------------------------
On Doom:
http://www.cdrom.com/pub/idgames/docs/rgcd-pips/FTP_WWW_sites.html
On VRML/Cosmo Player:
http://vrml.sgi.com/
On WadToIv:
http://www-white.media.mit.edu/~kbrussel/wadtoiv.html