I whipped up a distance based collision detection system, dubbed Disc Collision. A very basic model for collision detection, but also very fast in comparison to the vector based hitTest() in the Flash API.
Collisions are detected by a request-only model. The collision detection simply manages a collection of points and distances associated with each point. So you could easily put this into your a game engine and run an update call to get colliding points.
The algorithm is robust and has a few things to optimize. The collection of points is subdivided into multiple lists according to a spatial grid. To reduce the amount of work required detection. Then all of our points are sorted through a BST by distance so that we always know the largest distance to use when selecting grid sections.
Hold the red button down below to create objects to test collisions.
You can get code here:
http://code.google.com/p/disccollision/
Monday, July 20, 2009
Saturday, July 11, 2009
Invert the colors on your Mac
Just found this out, to invert the colors on your Mac hold ctrl-option-command and press 8. This is really useful if you're staring at white screens all day long your eyes will get tired really quickly.
Thursday, July 02, 2009
Motor2 Physics
I bought a new Macbook Pro and got it up and running. Funny how I've been using Mac's for a while now but never owned one myself. A computer is a computer.
I've been playing around with the Motor2 physics engine. I'm working on some games using it right now. I'll post and follow up when they're ready.
For now check out this new Flash port of the Box2D engine by Eric Catto here:
http://lab.polygonal.de/motor_physics/
I suggest reading the code and using the original Box2D documentation:
http://www.box2d.org/manual.html
Enjoy.
I've been playing around with the Motor2 physics engine. I'm working on some games using it right now. I'll post and follow up when they're ready.
For now check out this new Flash port of the Box2D engine by Eric Catto here:
http://lab.polygonal.de/motor_physics/
I suggest reading the code and using the original Box2D documentation:
http://www.box2d.org/manual.html
Enjoy.
Tuesday, June 09, 2009
AS3 Visual effects through BitmapData.getPixel()
I know lots of other people have created similar effects too. I just haven't done it myself. Here's an interesting effect you can get from the BitmapData.getPixel().
I'm creating a grid of squares to represent an image captured from the web camera and changing the size of a squares based on the corresponding color value.
If you don't have a web camera. No web cam?

Here's the code.
I'm creating a grid of squares to represent an image captured from the web camera and changing the size of a squares based on the corresponding color value.
If you don't have a web camera. No web cam?

Here's the code.
Thursday, April 23, 2009
How to turn off modsecurity (apache module)
I'm running fc10, Fedora 10 Linux.
Newly installed server and I'm just interested in doing some development for a web application. Modsecurity is used for implementing protocol level security, but it is not for everyone. Using it requires internet security knowledge. Four reasons not to use mod_security
Here's how to turn off modsecurity. Locate in
And for "DetectionOnly" switch this to:
And of course, restart apache once you are done:
It is recommended to run modsecurity in detection only until you are comfortable with writing rule sets.
Newly installed server and I'm just interested in doing some development for a web application. Modsecurity is used for implementing protocol level security, but it is not for everyone. Using it requires internet security knowledge. Four reasons not to use mod_security
Here's how to turn off modsecurity. Locate in
/etc/httpd/modsecurity.d the line:SecRuleEngine OnAnd for "DetectionOnly" switch this to:
SecRuleEngine DetectionOnlyAnd of course, restart apache once you are done:
# service httpd restartIt is recommended to run modsecurity in detection only until you are comfortable with writing rule sets.
Subscribe to:
Posts (Atom)