fov : shadow cast implementation

by on Jan.08, 2010, under flash performance, graphics

Knowing the  field of view (fov) of an object, provides some interesting use cases. Determination of what is in sight of a character, lightening…and other ideas. There are some brilliant algorithms for bitmap based calculations out there: BASIC, Digital, Permissive (several variations) and ShadowCasting.  I decided to implement the ShadowCast algorithm in as3, due to the overall performance in indoor and outdoor environments.

Here is a simple example, to show the functionality (click for interaction):

My implementation is very specialized and contains a lot of redundant code. Initially, I planned to create a flexible implementation, detached from bitmaps and visibility rules, handled by a given object. Mainly responsible for that is the fact, that function calls are relatively expensive.

Do you have any ideas to further improve the performance?

Here ist the source:


3 Comments for this entry

1 Trackback or Pingback for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


A few highly recommended websites...


    All entries, chronologically...