Topic: Fun With Raycasting (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
![]() Greetings, my beloved asylum! Like a bad girlfriend, I can't stay away. |
Nervous Wreck (II) Inmate From: |
![]() Was much easier than I expected. The code is updated and now the floor is slathered with a lovely XOR texture. |
Nervous Wreck (II) Inmate From: Portland Oregon |
![]() Hey Ironwallaby, I think i played with your script when I was learning about the canvas tag. I remember it worked a whole lot faster when I switched to setTimeout instead of setinterval. I have no idea why. I ended up placing the setTimeout for the draw function in the keyhandler function. That way it only calls draw when you move and it needs to redraw. |
Nervous Wreck (II) Inmate From: |
![]() Alright, one more update for the evening. I basically rewrote the whole thing to clean up a lot of the mess... |
Nervous Wreck (II) Inmate From: Portland Oregon |
![]() Yeah, I had made your dhtml one work in canvas but I couldn't get the tex variable figured out and it was not drawing the textures clean enough. Your original one used images for each sliver of the blocks drawn. So i just used the canvas image to do the slicing based on your tex variable. It's pretty fast. I also did one with colored divs that get lighter as you approach. Here's a link. |
Nervous Wreck (II) Inmate From: |
![]() Oh, I follow now! My mistake, that one was definitely me. |
Paranoid (IV) Inmate From: Norway |
![]() iron_wallaby: On my 2Ghz notebook, your script runs at ~30fps in Opera 9.63, ~40fps in Opera 10a, ~50fps in FF3.1b and ~75fps in SF4dp2. Alas FF lags a bit at updating the BMP image though. |
Nervous Wreck (II) Inmate From: |
![]() Cool stuff, p01. |
Paranoid (IV) Inmate From: Norway |
![]() I aslo believe a Canvas based hybrid ( mode7+raycasting ) approach is the way to go. It produces a much more consistent quality of final rendering and ends up with a much more stable framerate. |
Nervous Wreck (II) Inmate From: |
![]() You're right, it's much improved in Opera 10. I'm still going to have to tweak for more performance, but it's a much smaller jump. (To it's credit, though, Opera has by far the prettiest rendering.) |
Nervous Wreck (II) Inmate From: |
![]() Edit TP: spam removed
|