home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
OBJGLV.ZIP
/
OOPGLOVE.DOC
< prev
next >
Wrap
Text File
|
1993-05-12
|
10KB
|
209 lines
PLEASE NOTE: This file is in chronological order, not REVERSE chrono
order like most revision histories. See the end of the file for the
most recent additions.
============================================================================
Credits:
----------------------------------------------------------------------------
Originally "power.c" (c) manfredo 9/91
Address: manfredo@opal.cs.tu-berlin.de
----------------------------------------------------------------------------
Ported to PC compatibles by Greg Alt 10/91
Address: galt@peruvian.utah.edu or galt@es.dsd.com
----------------------------------------------------------------------------
Substantially rewritten by Dave Stampe (c) 1991: PWRFILT.C
No cash, no warranty, no flames. This stuff works great, so gimme credit.
Address: dstamp@watserv1.uwaterloo.ca 17/10/91
----------------------------------------------------------------------------
Converted to C++ by Mitch Allen 11/91
Address: 76040.2757@compuserve.com
This source was adapted from theGlove.c contained in pglove.zip
It is suggested that you download that file for instructions on
how to build an interface for the Power Glove to your PC.
(TWOGLOVE.DOC contain all necessary information
on connecting the glove to a parallel port. -MTP)
Significant enhancements:
- Glove code now contained in a class.
- In theory multiple glove objects could be spawned easily.
Helpful if someone ever invents one for we lefties.
- Derived glove classes may be developed.
// Made more object-oriented by Mark Pflaging 5/29/92.
// Compuserve 72033, 1552
//
// ReDesigned for a 486/33. I am trying to paramaterize the
// timing constraints so that it will be easy for "someone"
// or "something" to adjust them for the particular computer
// it is running on. These parameters appear in calls to 'Channel'
// constructors, see "SMOOTH.HPP".
//
// I spent some time experimenting with the hardwired values in
// the fdelay calls, and making calls to fdelay.
//
// The graphics are now autodeteced and autoscaled depending on your
// hardware's highest res graphics! I'm developing this on
// a hercules graphics card while I await a 24-bit color card.
// (boy that's an upgrade!)
//
// Somebody still needs to do autodetection
// of the port that the glove is connected to. Compuserve
// files describe how to build the parallel port interface.
// Another goal was to break Mitch's big objects into smaller
// ones whose functions are more specific. I am probably going
// to move this thing to Windows, so the more object-oriented the
// better. But mostly, I'm gonna make these graphics a lot better.
//
// Summary of improvements to graphics:
// Inside the former recatangle appears a representation of the
// glove, movable fingers included. If you twist your wrist, the
// glove rotates too! This is accomplished using a "metagraphics"
// approach, which essentially takes a set of points describing
// the still hand and applies a mathematical translation to
// the "deglitched" glove input.
//
// I also made the buttons turn on and off certain features, these are
// documented in the on-line help.
//
// There's a lot more that can be done with this code!
//
// RELEASE 2 9/28/92 Mark Pflaging
// Many, many nice improvements have been made!
//
// Most importantly, the code is now machine independent!
// This was achieved by precisely computing delay constraints
// for the inner delay loops. Code has been tested on a slow
// 286 up to a 486/50 and should work for faster machines when
// they are available. Thanks to Kendall Bennett for the
// indispensable timer classes. Also thanks to D. P. Research
// Company for providing guidance and the basic strategy for
// computing the timing constraints.
//
// Secondly, the glove sampling is now interrupt driven!
// I cannot give a full explanation of interrupts here for
// those not in the know. To put it simply, there is a way
// to set a chip on motherboard to generate an "interrupt"
// at an extremely predictable rate. Every time an interrupt
// occurs, a piece of code is called which samples the glove.
// The beauty of it is that the computer can be doing some-
// thing completely different between interrupts! The rate
// of sampling can be precisely controlled, and appears to
// take place in the "background." This code (ISR.CPP and
// ISR.HPP) is a C++ conversion of code in Dave Stampe's
// REND386 V3. So thanks go to him for making his source
// available, and giving me a clue as to how interrupts work.
//
// Thirdly, MANY parameters that control both the driver and
// the demo program are read from the GLOVE.INI file which
// has a format many will recognize from MS Windows. The code
// for reading this file was written TOTALLY from scratch!
// It is a GENERAL PURPOSE set of classes that is, dare I
// say, an example of rather advanced Object Oriented Programming.
// You may find these classes (INI.HPP and INI.CPP) useful in
// many other applications! It is a great way to allow users
// to change program parameters without recompiling or having
// to remember 16 billion command line switches. Also, it is
// a somewhat standard format. See GLOVE.INI for program
// specific parameter descriptions. TESTINI.CPP contains a
// sloppy test of the class.
//
// Some improvements have been made to the class hierarchy
// of the driver. It should now be easier to understand.
// The problem with the buttons has been fixed.
//
// In the intervening time between releases, I have learned a
// lot about how the glove behaves in different situations.
// If you are experiencing problems such as jumpiness or
// dimensions not responding, read HELPME!.DOC. GLITCHY
// RESPONSE IS NOT THE FAULT OF THIS CODE! There is VERY
// little I could do with software to eliminate the
// problems with shadowing. But you need NOT get used to it!
// My glove is responding near the accuracy of a mouse!!
// Yours can too! Read HELPME!.DOC!
//
// Well, sorry it took so long, but I hope you like it and/or
// find it useful. The next step is to add an event queue
// that holds glove, mouse, and keyboard events. Then I will
// add a module to interpret glove gestures and put them
// back into the queue.
//
// All code not otherwise indicated has been
// written independently by Mark Pflaging. Credit has been
// given in those sections of the code which did not
// originate with me. Since the original parts of the code
// are copyrighted, you must credit Mark Pflaging in order
// to legally use the original code for ANY purpose.
//
// RELEASE 2.1 11/20/92 Mark Pflaging
// This is basically a maintenance release, but the discerning
// lurker will notice a lot of nice touches.
// 1) Erroneous PGPINS.GIF no longer here.
// 2) Now compiles under Borland C++ 3.1.
// 3) If there is no glove attached, any key will get you out.
// 4) The last "piece" of the thumb is now present.
// 5) Timings are printed even if glove is not found.
// 6) Glove's arrow keys now change the color of the moving cursor.
// 7) Smoothing functions can be turned off from glove.ini.
// 8) 'makefiles' now work.
//
// Most importantly, the driver compiles for Windows!!
// The full demo is not in place for Windows yet,
// but there is a simplified demo that works under Windows & DOS.
// See WINDOWS.DOC for more information.
//
// More thanks:
// To Mike Ogrinz for "discovering" how to make the LEDs
// stay on instead of blink (sorry I forgot you last time, Mike.)
//
// To PCVR, whom are publishing an article about this code.
//
// To VRASP, for, well, being VRASP.
//
// RELEASE 3.0 (5/12/93):
// New features:
// 1) Support for two gloves simultaneously! The code supports
// two right handed gloves or a right and a left handed glove
// (or two lefts) through a setting in GLOVE.INI.
// 2) Gesture recognition completed! See GESTURE.TXT for more
// info. This is a very powerful feature that may take some
// time to fully appreciate.
// 3) Full Windows "Demo" program completed! A neat feature of
// the Windows demo is that it can send sounds to the Windows
// 3.1 Multimedia interface upon reciept of gestures. See
// GLOVE.INI.
// 4) This code has been integrated with Rend386 (Version 4) which
// yields some neat benefits. You can use gestures to fly
// around in the world. And you can have two gloves visible
// at the same time, and use them simultaneously to either fly
// around or select and move objects. See DEMO4B.DOC (if included).
// 5) There is a rudimentary "glove-mouse" driver that works
// in Windows. It lets you use the glove to control the mouse
// cursor. There's a bunch of bugs, but you can use it to
// play solitaire or chess or whatever. That is, until
// you start feeling that sharp pain in your arm!!!!!!!
//
// I'm not sure if you'd consider this a feature or not, but
// full source code is no longer included in the freeware
// distribution. You can purchase the compiled libraries
// and header files, or the full soruce code. Most customers
// will only need the libraries. I do not intend to change these
// libraries in any major way. They should now be considered to
// be complete modules. See PRODUCT.TXT for ordering info.
//
// !~\ /~!
// | \ / |
// ! \ / ! A"A |~~~\ | /
// | V | A___A |___/ |K
// ! ! A A | \ | \
// | | _____/ \______
// V V
// -^- -^-
//