Happy Eid Muslims!
Eid al-Fitr is a festival celebrated by Muslims after fasting month of Ramadan π
Happy Eid! π
Working On Terrain
Right now I’m working on terrain manipulation & rendering…
I’ve done some basic terrain rendering in the past using the Brute Force approach, What I’m trying now is the LOD (Level Of Detail ) algorithm!
I’m having some difficulties now with the normals π¦
The quad tree implementation is almost finished, right now I’m rendering the terrain using the highest level of detail ( always going to the leaves of the tree & render them ), of course that will be fixed later after I’m done with some issues like normals & some optimization…After all, what benefit is LOD without increasing the performance? π
Here’s a screen shot, the terrain is rendered in wireframe! no one will stand the way it looks in the solid FillMode ( the normals issue π¦ )
I painted the height map using only Windows7 Paintο»Ώ
I hope that I can complete this project, then I might add some trees & grass ( It’s time I learned BillBoarding ) & of course fill the river with animating water!
If you’re interested in LOD you can check these links:
Gamasutra.com : Realtime_Dynamic_Level_of_Detail
Gamasutra.com : Continuous_LOD_Terrain_Meshing
Smart Terrain Rendering with XNA
Note: gamasutra articles are more than one page! you can view all pages within one browser tab, just click the printable version button
Mediafire is under maintenance!
Hello π¦
As you can see, the server is under maintenance!
Usually I only upload my files to mediafire which makes sharing files easier, I have a free account there and it works fine! resume capability is available & the server is fast! π
The files are still there! It’s only a mater of time… π
3D Water Bodies
This is a simple XNA project that simulates an ocean…
The idea first came to me when I was practicing on creating terrain using heightmaps! I was playing with the vertices of the terrain, giving them some motion on the Y Axis then I said to my self: “Wow! This looks like the sea wavy water! :D”
The principle is simple! examine this very simple example:
I have 9 vertices forming 4 quads
I also have an array of 9 integers to determine the direction of each vertex : up/down
when first initializing the WaterBody, a random value between -n,n is assigned to the Y component of each vertex. so each vertex should start with a random Y component… The direction of each vertex is also generated randomly!
Now all I have to do – every frame – is to move each vertex in its direction, if Position.Y<-n or Position.Y>n then fix Position.Y and change the direction of the vertex ( if up make it down, if down make it up! pretty simple huh? π )
If you apply the above to a larger number of vertices ( I used 70×70 in my project ) you’ll have a nice wavy water!
Adding some lighting and texture will make things better ;).
Adding sound effects will make things even better! π π
Here’s the final result!
You can control several things in the application like enabling/disabling lighting and texture, changing camera position…
You can change the max wave height,wind speed and the application will automatically randomize theΒ waves!
WaterBodies Executable ( 144 KB ) – XNA Redistributable 3.1 Required ONLY if you don’t have XNA Game Studio 3.1 installed
WaterBodies Source Code ( 183 KB ) – XNA Game Studio 3.1 Required
Revisions:
rev. 1 : Position,Rotation,Scale properties are now available! the WaterBody class is now more flexible than before!
rev. 2 : Updated camera class, now it’s a free look camera. Code now is more tidy..
Hanoi Towers
Hanoi Towers is a game where the objective is to move all discs from tower A To tower C BUT there are two simple rules :
- you can’t place a disc over a smaller one
- you can only move one disc at a time!
The problem can be solved using a recursive algorithm..
Actually my college partner Hashem Al-Rifai and I programmed this simulation for our college algorithms project
We used C++,OpenGL and SFML ( what a mixture π )
The reason we used SFML is because it makes working with windows,input and sound much easier, it saves you the trouble you might run into when using only OpenGL :D…
You can check Wikipedia for more information and algorithms…
Here’s our application:
You can rotate the scene,add more discs
Press Tab for fast animation!
We added some cool mouse features! please read the console window for more details π
You
You can add up to 18 dics π , you don’t wanna do that since it will take forever to solve! don’t you believe me? go ahead and try it π
Hanoi Simulation Executable – SFML and OpenGL Required Dlls are included
Hanoi Simulation Source Code – SFML and OpenGL headers and libs are NOT included
Gokigen Naname
Gokigen Naname is a japanese puzzle where you have a grid…
some nodes on the grid has numbers from 0-4
each square on the grid should contain only on diagonal line
The number on each node (n for example) means that this node should have precisely (n) lines connected to it. the grid shouldn’t contain any closed loops!
For more details please refer to Wikipedia!
This “Game” solves the puzzle supplied by the user..so actually it’s not a game since the player won’t do the solving..
Click on any node with the left/right mouse button to increase/decrease its number…
The game is programmed using C++ and SFML
SFML is a powerful 2D Library but since C++ is a headache (at least for me :)) I prefer using XNA with C#
There’s also a .Net SFML library but I never tried it!
You’ll have to forgive me for a bug in my program π¦
When you want to change the value of a node, don’t click on the node! See the picture below
You have to click where the red circle is π¦ , The code is old now and as I said before C++ is annoying, that’s why I didn’t fix this problem and I wont!
Gokigen Naname Executable (718 KB) – Required SFML Dlls are included
Gokigen Naname Source Code (99.7 KB) – SFML Headers & Libs not included
Spinning Rings
Some spinning rings π

It’s cool especially when you see the original size GIF!
For each ring I used a Torus and modified the properties Slice From,Slice To….And then rotated each ring!
Unfortunately DirectX Files (.x) doesn’t support the Slice From,Slice To properties for objects π¦
The Files :
3D Coin
Here’s a simple 3D coin, 3DS Max 9 π
of course the 3DS Max image and the video are much cooler than the DirectX file because in max you can use the pump method to make the model look engraved when rendered… unfortunately! pump isn’t supported in .x files π¦ OR I don’t know how to use it!
Light Tank Model
A simple tank I modeled with 3DS Max 9…:)
The idea started with a tractor wheel then I decided to make a whole tank!
You may ask why creating a tank with wheels?? Two reasons :
1- As the name indicates it’s a light tank not a heavy one!
2- Until now, I have no idea about animating the tank treads!
Here are some photos of my tank:
Space Defender : A Complete XNA Game by Ghoshehsoft
Space Defender
Update: Game updated to XNA GS4.0 , Download links added!
This was my first XNA game! It’s a cool 2D Game..
Unlike most space games, this game takes place in the atmosphere! not in the outer space π
You have to defeat the invaders as they increase in number, you’ll also come across mother ships which are more advanced enemies that will chase you and fire energy pulses at you!. Play for some time and you’ll confront the Main Mother Ship…you think you’re up to it???
You have two weapons to stop your enemies : a rail gun that will fire small rapid bullets , and a missile launcher that fires missiles causing massive damage to your enemies!
The player can choose one of three Space Ships to play the game with… each space ship has it’s special ability : Rapid Fire, Turbo Ship, Heavy Armor…and if the player beats the game twice with two different ships, The ultimate ship will be unlocked!
You can play the game with your mouse ( I like to sit back and destroy the invaders just with my mouse π ) OR with your keyboard
Instructions on how to play the game can be found under the How To Play window in the game.
Taking the repairs box is always a good idea!! a small white repairs box will show up from time to time! take it to regain health.
You can control the speed of your ship in the game, See How To Play for more instructions
Enough Talk! Let’s Play!
Download The Full Game Executable XNA 3.1
Download The Full Game Executable XNA 4.0
Full source code link at the bottom of the article
If you don’t have the XNA 3.1 SDK installed on your computer, you’ll have to install the XNA Redistributable 3.1, download it here for free.
If you like the game please let me know! my email is hisham.ghosheh@gmail.com
Some images of the game:
For XNA Developers:
Let’s talk a little about the game code & structure…
I programmed this game using XNA Game Studio 3.1 & C# 2008



















