|
|
I opened this page so that all the mini-projects I put my time into won't be left in my '/myproj' directory. People are encouraged to play with these examples, learn from the source-code supplied, ask questions and point out mistakes. If you use the code in your applications/products/etc, drop me a line.
I started working on a terrain engine around October 2000. I was deeply moved by screenshots from black and white :)
The outcome is an engine that hold a (supposedly) 1km by 1km piece of terrain
with very high accuracy. There is no triangle-cutting algorithm employed, simple
brute-force. I use a large terrain texture and a tiling detail texture. There's
a skybox and the terrain reflects A few screenshots :
Binary (win32) + Source:
terrain engine.zip (compile in debug, release gives problems :) Thanks : Yoni Lavi - dynamic camera and
general coordinate-system fixups.
After the WTC attacks, CNN started using their Weather-System Simulation Program (I think) to show Afghanistan and Tomahawk missiles flying :) This looked very nice and moved by the fact that I really didn't know too much geography and had a day or two free (Sukkot Holiday), I went on and wrote my own Earth Simulation program. The program is based on a large sphere, with a nice texture of the earth is mapped to. You can rotate the earth, zoom-in, etc, etc. What's GIS you ask ? Well, GIS stands for 'Geographical Information System', which actually means adding any type of information layer to a raster or vector map of the world or a portion of it.
What do I have to do with GIS ? After rotating my small earth for a few minute I started to get bored again, so I went on a hunt to find information layers that I could add. Here are screenshots of the application in various information-display states : (click the shots to see a larger version) Where did the information come from ? The information about the location of the Countries came from something called 'The CIA FactBook 2000'. It's basically an html page with links to about 200+ countries, each one has a page with facts (including Latitude/Longitude information). I downloaded all the pages using Flashget's 'Download All' (thank god for that option), and wrote a small program that fetches all the countries names and positions and generates a '.H' file with all this information. Vector information on Coastlines, Political
Boundaries, Rivers, Lakes, Islands and US-States was much harder to get. The small conversion programs are included with the source-code provided below. I didn't include all the versions of the data because they take almost 10MB alltogether.
Now, What can we do with the program (function-wise) ?
You can enable/disable the big Earth-Texture.
Some Notes on the application itself : Use the mouse and it's left-button to rotate earth. Hold down Ctrl before you hit the left mouse button to scale the earth. Right-Click the window to get the options menu. Note that options are controllable by keyboard too. Country Names are shown based on Z, the more you zoom in the more country-names appear. Countries are shown using small red sine-scaling glutSolidCubes.
Some notes on the 3D : I used OpenGL for this one, it was simple and straightforward. I generate a large sphere for the earth, use glSolidCubes for the countries, and simple GL_LINE_STRIPs for the vector-data. There are no display-lists or any other optimizations, I just throw everything at the card :) I used glut for wrapping up all of Windows's internal calls, mainly because the first app-skeleton I found used it and provided some minimal texture-loading calls. Apparently the skeleton is by Andreas Gustafsson, I can't remember where exactly I found it, sorry. I used a font library called glTexFont by Nate Miller, it uses the Quake3 Font, cool :) Some thanks to the people at #opengl (efnet I believe) for helping me correctly placing the country-names (especially f00Dave, thanks for all the help).
Downloads : Binary (win32) + Source: earth_simul.zip The source is provided for your enjoyment, free-use, modification, etc. Feel free to contact me if you find a bug, add a feature, or anything alike. Interceptor combat is a program coded by Yonthan Lavi and myself. It was initialy intended to be hte major part of a demo we started writing but decided not to enter in an Israeli demo-compo. Since then we left it unchanged until we decided to try and enter it to flipcodes (www.flipcode.com) coding contest (subject: Vehicles).
floowing is a short description : terrain engine by kombat, simple brute-force terrain grid, with multipass
textures, water has a nice caustic animated texture on them. Skycube textures
were generated by TerraVox and blended with blue haze to fit the scene's fog
color.
Screenshots:
Downloads : Will be added soon
Downloads: Binary (win32) :
download\pqtorus.zip
Always picture is a small program that I wrote for my girlfriend to try and cheer her up during long working hours. It allows you to scatter bitmaps on your screen and continue working with these bitmaps on-top of you screen's contents. You can give images speed, to get clouds moving on the top of your screen :-) (they come back from the other side once they disappear). You can close all of your pictures with a menu that pops when you right-click images. Using the mouse you can easily drag and drop the picture to anywhere you want on the desktop. The app uses a feature introduced in Win2000 called 'Layered Window Attributes' that allows to easily use color-keying and alpha-blending on entire windows. Download ( Source + Win32 Binary ) : AlwaysPicture.zip |