Author Topic: Nspire Raycaster  (Read 106902 times)

0 Members and 1 Guest are viewing this topic.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Nspire Raycaster
« on: March 23, 2010, 01:23:20 am »
I finally got around to writing some code for my Nspire raycaster project. Right now it is shamefully featureless, as it basically draws untextured walls from a scene defined by a hard-coded array in the source:

The big problem I'm having right now is getting the animation not to flicker (the above screenshot was not animated). Does anyone here (maybe calc84maniac?) know how to do flickerless animation on the Nspire?
Once I get the animation working, I'll add other things, like texture mapping and sprites. Also, does anyine know how to pause execution for a specified amount of time (so I can limit the frame rate)? Right now, from my preliminary flickery code, it seems like I have plenty of speed to work with.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #1 on: March 23, 2010, 01:28:45 am »
wow awesome, I hope to see more work on this :)

I wonder if you could eventually combine both raycasting and Mode 7? Calc84 did Mode 7 and raycasting, altough on z80, but he could maybe help for the Mode 7


Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Nspire Raycaster
« Reply #2 on: March 23, 2010, 02:30:46 am »
Nice, glad to see you got this working.  Did you end up using the small step or the vertical/horizontile method?  Judging from the side shading on the walls I'm guessig it's the latter?  Looks good :)

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #3 on: March 23, 2010, 02:56:26 am »
The horizontal/vertical method.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Nspire Raycaster
« Reply #4 on: March 23, 2010, 02:58:51 am »
Seems you might have a case value for the column directly in front of the camera :P maybe offset all of the columns by .5 degrees?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #5 on: March 23, 2010, 03:38:14 am »
I wonder... in the future, will you implement variable wall height? Calc84maniac had a raycaster using these in the works for a while for the 83+:

(Must view in Firefox or Opera, since other browsers won't support 30 fps gifs)






Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: Nspire Raycaster
« Reply #6 on: March 23, 2010, 12:37:41 pm »
Great!

I've got one little additional remark: most of the screen is left unused. I've never written raycasting/raytracing code, but is there a reason?

As for flickering, calc84 should know, he wrote the GBC emulator and such.

Offline JoeyBelgier

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 545
  • Rating: +25/-21
  • Joey
    • View Profile
Re: Nspire Raycaster
« Reply #7 on: March 23, 2010, 01:12:51 pm »
The raycasters on the 84+ with textures  (Wolfenstein83 and Gemini) don't use a large part of the screen either.
This because making it wider (so having to check more lines) uses a lot of recources.

Even at the 68k's a big part of the screen is not used for the raycasting.
The raycaster Cal84 made runs full screen but note not a lot of textures are added, no enemies so no AI having to run , no objects.. (:

I love those damn screenies

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #8 on: March 23, 2010, 01:37:03 pm »
Keep in mind, though, that the Nspire is 90 MHz (or more?) while the 83+ is 6 MHz.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Nspire Raycaster
« Reply #9 on: March 23, 2010, 01:49:34 pm »
I'm seeing some Halo in the future. :D :D
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #10 on: March 23, 2010, 04:07:13 pm »
I think I can implement variable wall heights. The emptyness of the screen is because my walls are not very high, which is easily fixed. Right now, my biggest priority is figuring out how to get smooth motion.

From what I have right now, I think I have plenty of speed left, especially since I haven't started optimizing yet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #11 on: March 23, 2010, 04:16:04 pm »
What will be the maximum amount of shades of gray supported? (knowing the Nspire can do 16)

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #12 on: March 23, 2010, 06:18:51 pm »
Once I get texture mapping done, it will support 16 shades. Right now, there are only two shades.

A question: in src/arm/headers/common.h in the Ndless package, there are several keycodes. Does anyone know where I can find more of these codes? Also, are the direction keys also considered keys, or is it some sort of analog device with infinitely many directions?
« Last Edit: March 23, 2010, 06:25:52 pm by bwang »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Nspire Raycaster
« Reply #13 on: March 23, 2010, 06:25:28 pm »
aaah ok, I was unsure. 4 levels of gray would be ok, though. Even monochrome, altough it wouldn't be pushing the Nspire to its limits as much XD. But we have to start small when coding anyway, IMHO. It's good to be ambitious, sometimes, but we have to make sure to not be way too ambitious either. ^^

Some people who are totally new at something will sometimes go with the largest possible RPG project, then realize it was too much for them x.x. I usually start with something small, see if I can do it, then expand.
« Last Edit: March 23, 2010, 06:31:21 pm by DJ Omnimaga »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #14 on: March 23, 2010, 06:36:56 pm »
aaah ok, I was unsure. 4 levels of gray would be ok, though. Even monochrome, altough it wouldn't be pushing the Nspire to its limits as much XD. But we have to start small when coding anyway, IMHO. It's good to be ambitious, sometimes, but we have to make sure to not be way too ambitious either. ^^

Some people who are totally new at something will sometimes go with the largest possible RPG project, then realize it was too much for them x.x. I usually start with something small, see if I can do it, then expand.

16-level gray is pretty easy to do, considering the Nspire has hardware grayscale support.
I don't feel this project is terribly ambitious yet. Notice I have absolutely nothing planned for gameplay--right now, I'm just experimenting with raycasting.