• Advertisement
  • entries
    222
  • comments
    608
  • views
    588743

JavaScript Raycaster

Sign in to follow this  

1847 views



A silly project from over the weekend: JavaScript raycaster.

I couldn't work out how to handle keypresses in Firefox, and Firefox is too slow and flickery to make it worthwhile. IE runs it fine but at less than 1FPS, meaning that more often than not you end up walking through the walls. Opera is about the only browser it works happily in (~12FPS). Ah well.
Sign in to follow this  


7 Comments


Recommended Comments

Mozilla has one and I'm sure The5K had a few.

Edit Mozilla's uses the nonstandard <canvas> tag.

Share this comment


Link to comment
Well it looks awesome, but I really don't feel like installing Opera. FireFox I got 10FPS but couldn't move and IE I got 1FPS.

Share this comment


Link to comment
I'm getting an average of 4 FPS in Safari (and the keys work) - but it freezes Camino.

Share this comment


Link to comment
Yay! 3fps (FX) and 12 fps (Opera) here. I'm wondering how fast this might run with the canvas tag. I might do some experiments later, but not until at least the weekend (exams and so forth). [grin]

Edit: I get about 8 fps in SeaMonkey... Maybe it's just Firefox that sucks? ;) Perhaps it's my extensions.

Share this comment


Link to comment
The Mozilla Raycaster uses

onkeydown="press(event);" onkeyup="release(event);"

I see yours take no parameters.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Quick Firefox fix:

FIND:
onkeydown="KeyDown();" onkeyup="KeyUp();"
REPLACE WITH:
onkeydown="KeyDown(event);" onkeyup="KeyUp(event);"
FIND:
return window.event.keyCode;
REPLACE WITH:
return (window.event) ? window.event.keyCode : evt.keyCode;

It's almost unusably slow, though.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement