home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
OBJGLV.ZIP
/
PROGRAMS
/
DEMO4B.DOC
< prev
next >
Wrap
Text File
|
1993-05-12
|
8KB
|
199 lines
Notes on Demo4B.EXE:
This is a modified version of "demo4.exe" that is included in
"demo4.zip". demo4.zip should be available from the same place
you got this file.
The primary reason to use demo4b instead of demo4 is that it
supports two gloves at once, and that it uses glove gestures
to navigate the world. Secondly, demo4b is a bit faster.
(Try them side by side.) Also, a lot of people have
reported that they couldn't get demo4 to work with the glove,
but they could get o2glove to work. So those people now have
a version of demo4 that uses a different (if not better) glove
"driver". This version fixes the following bug:
> How come in the *.wld files the skycolor opcode
> doesn't seem to work?
You can specify glove cursors (figure files) that have any
number of segments. I have used this to make different looking
cursors. Try "SQUARE.FIG".
The parameters to demo4b are essentially the same as demo4.
This makes it pretty easy to upgrade to demo4b. Some parameters
in the ".cfg" and ".wld" files are now ignored (or at least they
don't work). They are listed below:
GLOVEDEV name x y z rx ry rz
PGLOVEPORT in out writemask nonemask latchmask clkmask clklatch datamask image
PGLOVETIME bitdelay bytedelay
VIDEODEV name
The file GLOVE.INI has analogs of some of these parameters. I couldn't
ever get any of the other "loadable video drivers" to work so I
removed those sections of code that did the loading. It always seemed
a bit hokey to me anyway... This code always runs in 320x200x256
standard VGA mode.
Gestures specified in GLOVE.INI can control viewpoint movement and
object selection, movement and twisting. The file "GESTURE.TXT"
included in the distribution describes the format of the gestures.
Here I will only describe the function of each of the gestures
that is recognized by Demo4B. Object Glove programmers please
refer to "RENDGEST.CPP", "RENDGEST.HPP", "GLOVEPTR.CPP", and
other rend386 files if you wish to add gestures to control
other functions. The relevant sections in GLOVE.INI are
[1.Rend386], whose gestures apply to the first glove, and
[2.Rend386], whose gestures apply to the second glove. The
gestures in the two sections are completely independent (for
now). If one of the gestures (shown below) does not appear in a
section, that function will be inaccessible (you can still use
a joystick or keyboard). If you specify a gesture that is not
in the list below, it will be ignored.
Up
Move "Forward". (The name is "Up" because it corresponds
to pushing the joystick up).
Down
Move "Backward". (The name is "Down" because it corresponds
to pushing the joystick down).
Left
Pan the view Left.
Right
Pan the view right.
StraightUp
Move parallel to the Z axis, in a positive direction.
StraightDown
Move parallel to the Z axis, in a negative direction.
StraightLeft
"Sidestep" to the left.
StraightRight
"Sidestep" to the right.
GeneralExtreme
When this gesture is being sensed, the above gestures will
move the user more quickly through the world.
ExtremeUp
Same as "Up" above, but moves more quickly.
ExtremeDown
Same as "Down" above, but moves more quickly.
ExtremeLeft
Same as "Left" above, but moves more quickly.
ExtremeRight
Same as "Right" above, but moves more quickly.
TiltUp
Tilts the viewpoint up.
TiltDown
Tilts the viewpoint down.
TwistCW
Twists the viewpoint clockwise.
TwistCCW
Twists the viewpoint counter-clockwise.
Mode1On
Corresponds to holding the "first button" on the joystick.
Modifies the Up, Down, Left, and Right gestures to mean
"TiltUp", "TiltDown", "StraightLeft", and "StraightRight",
respectively.
Mode1Off
If this gesture is defined, gestures behave as indicated
above in Mode1On until this gesture is sensed. That is,
"Mode1On Off" message is ignored.
Mode2On
Corresponds to holding the "second button" on the joystick.
Modifies the Up, Down, Left, and Right gestures to mean
"StraightUp", "StraightDown", "StraightLeft", and
"StraightRight", respectively. If BOTH Mode1 and Mode2
gestures are in effect, the gestures are mapped to "TwistCW",
"TwistCCW", and zoom for the other two I think (they don't
work too well.)
Mode2Off
If this gesture is defined, gestures behave as indicated
above in Mode2On until this gesture is sensed. That is,
"Mode2On Off" message is ignored.
Select
Make this gesture, then make the glove collide with an
object. This object is now selected. This will be
indicated by the object becoming highlighted. Make
this gesture while the glove is not touching another
object, and the object will no longer be selected.
Move
When an object is selected and this gesture is being sensed,
the selected object will follow the motion of the glove.
Twist
When an object is selected and this gesture is being sensed,
the selected object will rotate to face the glove.
Sample gestures are provided in GLOVE.INI. There are a bunch of
commented gestures that utilize the glove buttons to navigate.
There are new parameters for .cfg and .wld files:
LEFTGLOVECURSOR filename
Specifies a .fig file containing a visual represenation of a
left-handed glove cursor. The default is "lhandsm.fig".
This is used if you specify "SearchingAlgorithm=Right-Left" in
glove.ini, and you have two gloves.
SCREENCLEARCOLOR index
Specifies which of the 256 available colors should be used
when the sky and the ground are supposed to be the same color.
SHOWFRAMERATE value
If 'value' is zero, the frame rate is not displayed.
SHOWLOCATION value
If 'value' is zero, the x and z position is not displayed.
SHOWGESTURES value
If 'value' is zero, gestures are not displayed. Even if they
are displayed, this function doesn't work correctly yet. Use
DOS_DEMO.EXE or WIN_DEMO.EXE to display gestures as they are
received.
SHOWCOMPASS value
If 'value' is zero, the "compass" in the upper right hand
corner is not displayed.
MOUSEDEV driver_name
IF 'driver_name' is "mouse", then the standard mouse driver
is used. If 'driver_name' is "NULL", then no mouse support
is included.
I made an adjustment in the way that the LOADPATH variable is handled.
Basically, I have a bunch of worlds on my hard drive in different
directories. I didn't want to have to copy the glove cursor files
to all of those directories. One way to get around this is to specify
the full pathname to every .plg and .fig, but this can get frustrating,
especially if you decide to move files around. So I changed the code
as follows: When you specify a cursor in rend386.cfg, it uses the value
of "LOADPATH" that was in effect at that time. If you redefine
"LOADPATH" later, then all other .PLG and .FIG files will use that
path. For example, let's say you have "handsm.fig" and all of the
other glove cursor files in the directory "c:\cursors". You have
"room5.wld" and all related files (except for "handsm.fig", etc!) in
the directory "c:\worlds\room". Also, you have only one copy of
"rend386.cfg", and it's in the "c:\" directory. You should make your
"rend386.cfg" file look like the following:
# other stuff...
LOADPATH c:\cursors
GLOVECURSOR handsm.fig
LEFTGLOVECURSOR lhandsm.fig
LOADPATH .\
# more stuff...
Now you can just "cd c:\worlds\room" and type:
C:\WORLDS\ROOM> demo4b /C c:\rend386.cfg .\room5.wld -g
Let's say you have the solar system world in the "c:\worlds\solar"
directory. You would type:
C:\WORLDS\ROOM> demo4b /C c:\rend386.cfg .\solarsys.wld -g
In both of the examples above, the program reads the same "rend386.cfg"
from "c:\" and loads the glove cursors from the "c:\cursors" directory.
OK, so its no big deal but it sure prevents a lot of redundant files
when you start collecting a lot of worlds (which you will sooner or
later!!)
The only other thing I want to say at this point is that demo4b
has been compiled as a C++ program rather than a C program.
I guess for some people that is a disadvantage, but for most
of us it brings real advantages.
-Mark Pflaging 3/24/93, 4/9/93, 5/12/93