Eye Poking Program
Author |
Message |
ericfourfour
|
Posted: Sat Sep 02, 2006 3:47 pm Post subject: Eye Poking Program |
|
|
I was recently browsing around the forums when i saw a program that just repeatedly pokes an eyeball and tears come out. So I thought it would be funny if I could use that concept and expand on it.
In this program you have a stick and you can manually poke the eyeball wherever you want. The cool thing about this is that the stick is generated using a fractal tree algorithm that I like to call fractal stick. The algorithm is similar to the one in zylum's recursion tutorial. Everything in this program is an object. Also when the eye is hit it activates two particle systems. They are the blood and tear systems.
You can post comments and suggestions but I probably won't reply until monday since I will be at Mosport for the rest of the weekend (if it stops raining). I will release the source after Monday since it still needs some optimizations.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
eyeball_poker.zip |
Filesize: |
278.86 KB |
Downloaded: |
255 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
ericfourfour
|
Posted: Sat Sep 02, 2006 4:25 pm Post subject: Mechanics |
|
|
I thought i'd go over a few of the mechanics of this program. You do not need to know this to use the program.
Here is how ths stick is made:
The stick is just an array of branches. Each branch has an x offset, y offset, angle offset and length. In the fractal stick recursion finds these values and creates a branch.
How the stick is always pointing at the eye:
The stick has one attribute which is the angle. The angle is found by using the mouse coordinates and the eye coordinates. Once the angle is found, each branch updates its x1, y1, x2, y2 using its values (offsets and length), the mouse coordinates and the stick's angle. Once those values are found everything is rendered onto the screen.
How the stick finds the branch that will always hit the eye first:
Since there is only one branch that has a chance of hitting the eye, the program needs to find it. When a branch is being created, the program will find the distance between two points. These two points are the top of the branch and a point that is perpendicular to the base of the origin and above the entire stick (the latter point is found by adding a rediculessly large number to the y origin). Once the distance is found, it is compared to the shortest distance (if there is one) to see if it is smaller. If the distance is smaller, the current branch is made the closest to the eye.
This all may be complicated to understand but it may be clearer once the source is released.
|
|
|
|
|
![](images/spacer.gif) |
Prince Pwn
|
Posted: Fri Oct 13, 2006 11:44 am Post subject: (No subject) |
|
|
Please when you make a program, make it so the user can terminate it without having to use the task manager to kill the process. Thanks.
|
|
|
|
|
![](images/spacer.gif) |
ericfourfour
|
Posted: Fri Oct 13, 2006 3:48 pm Post subject: (No subject) |
|
|
Or you could *gasp* press the escape key. It will free all of the allocated memory and close the window if you do this.
|
|
|
|
|
![](images/spacer.gif) |
ClayWall
|
Posted: Fri Oct 13, 2006 7:56 pm Post subject: (No subject) |
|
|
Why do the tears come from the middle of the eye? HaHaHa!
|
|
|
|
|
![](images/spacer.gif) |
Barloq
![](http://compsci.ca/v3/uploads/user_avatars/35731119745b8f75d6765c.jpg)
|
Posted: Fri Nov 10, 2006 10:12 am Post subject: (No subject) |
|
|
That's so randomly awesome!
|
|
|
|
|
![](images/spacer.gif) |
|
|