I've been playing around with jME (http://jmonkeyengine.com/) as an engine for a game, and after reading a post on the WWIIOL forums about how it would be nice if there was an alternative to the 'laser rangefinder' currently ingame. I decided to whip up a prototype to get myself a little more familiar with the jME framework.
Basically, the idea is to have the player responsible for setting an accurate range using the rangefinder, rather than having the computer calculate it automatically. This has the advantage of making the rangefinders a little more fun (IMHO) and more challenging to use, as well as eliminating the ability to hit 'R' ingame to range a target, and switch to the gunner/driver/etc. while the range is being calculated.
I originally wanted to have something that was similar to the method used in real life by tank-operators using a steroscopic rangefinder. As far as I can tell (from a bunch of googling) the rangefinders worked by either overlaying two images on top of one another in order to get the range, or by aligning two peices of a split image.
However, the problem with going with either of these routes is:
So, the method I implemented is as follows:
Here is a screenshot of how it looks (the range is not set correclty in this picture BTW :) ):
In order to demonstrate how quick and easy this is to implement, and how it would look and feel to the user, I implemented it in under a day (most of it was learning the jME API, the actual algorithm for moving the bars took under 1 hour to devise / implement).
A .zip file is available HERE of the program. It requires Java 1.4 or greater to run. A .bat file (run.bat) is provided to make running the program easier (you don't have to mess with stupid Java classpaths and whatnot). The jME and lwjgl .jar files and native libraries for windows are included in the ./lib directory in the .zip file.
Note: In the demo, the true range is automatically calculated every frame, rather than requiring the 'range' key be pressed.
Personal
My Blog
Resumé
Projects
Freetar
Music Flashcards
School Projects
Webpages
Fun Stuff
WWII: Online
Ants & Antfarms