Simple 3d raycasting engine in DHTML/Javascript.. HELP! :)

robertgamble

Newcomer
http://www.elephantsneverforget.co.uk/hroberts/editor/gme.asp am I the first to do this?? ;)

Anyways, anyone have any ideas of how to make it run a bit faster?? Texturemapping?? A better method of coloring and shading walls (I should be ashamed of the method I'm using!!) I fudged it together very quickly so there's probably alot of room for improvements..

Also is there a bug with Math.tan in javascript? "96 + (224-191)/Math.tan(60)" should return about 115, but it's waaay off.. (IE 5.5), I'm having to use a really crappy slow raycasting method because of that. Math.cos & Math.sin don't seem to like floats, hence the blocky edges on walls.


Anyways, please tell me what you think and let me know of any improvements you can think of.

(I think it only works in IE)
 
The Javascript Math.tan(), Math.sin() and Math.cos() functions expect their argument to be specified in radians rather than degrees. 2*PI radians = 360 degrees.
 
Back
Top