Author Topic: Nspire Raycaster  (Read 104847 times)

0 Members and 4 Guests are viewing this topic.

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 #15 on: March 23, 2010, 06:40:45 pm »
aaaah ok I see ^^, but on my side, stuff that technical is very hard to understand x.x. It's not necessarly just cuz of the low level programming, but more understanding 3D, because someone did a TI-BASIC raycaster before and I still couldn't understand, even if it was written in TI-BASIC, which I programmed for 9 years. Axcho from UTI is the person who did the program.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #16 on: March 23, 2010, 06:51:43 pm »
Never mind the key code question; I found the key codes here: http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#900E0000_-_Keypad

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Nspire Raycaster
« Reply #17 on: March 23, 2010, 07:35:40 pm »
Hmm, what is this "flickering" you speak of...
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #18 on: March 23, 2010, 07:38:12 pm »
I believe he wants to know how to draw to the buffer without updating the screen.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Nspire Raycaster
« Reply #19 on: March 23, 2010, 07:46:06 pm »
I believe he wants to know how to draw to the buffer without updating the screen.
Draw to another buffer and copy it over, I would think.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #20 on: March 24, 2010, 12:38:54 am »
What is the best way to create a second buffer? I tried making a 320x240 array, but the program just crashed.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #21 on: March 24, 2010, 01:30:57 am »
I don't have double buffering working yet, but I do have texture mapping:

The textures are only 8x8 though, since I had to hand-code them.

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 #22 on: March 24, 2010, 01:34:27 am »
Darn awesome! How many FPS do you get approximately on calc? (remember you'll have to slow down framerate a bit for on-calc usage since the Nspire LCD is so blurry) Also are these textures 8x8?

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Nspire Raycaster
« Reply #23 on: March 24, 2010, 01:43:24 am »
Yay! Higher walls! That looks very cool! :D
Former Coder of Tomorrow


Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #24 on: March 24, 2010, 01:44:51 am »
Yup, the textures are 8x8.
I can't really tell how many FPS I'm getting. I think any numbers I get right now would be meaningless, since I have a feeling much of the time is spent refreshing the screen every time I draw a pixel.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Nspire Raycaster
« Reply #25 on: March 24, 2010, 07:38:07 am »
A 320x240 array is wayyy too big. (Also, it doesn't help me if I don't know the size of the elements)

And what do you mean "refreshing the screen every time I draw a pixel"
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #26 on: March 24, 2010, 02:05:27 pm »
A 320x240 array
meaning >9000 :O

Sorry couldn't resist :P
« Last Edit: March 24, 2010, 02:05:41 pm by DJ Omnimaga »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Nspire Raycaster
« Reply #27 on: March 24, 2010, 06:17:17 pm »
I'm using the setPixel() function from the Ndless demo to draw to the screen, which I presume has to refresh the LCD every time it is called.
The array elements are ints.
« Last Edit: March 24, 2010, 06:17:51 pm by bwang »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Nspire Raycaster
« Reply #28 on: March 24, 2010, 07:27:08 pm »
320x240? Thats MASSIVE! Are there going to be any speed issues with checking against an array of that size?

Also you might be able to come up with a nifty verticle scaled texture-slice routine to speed things up mebbe? (or cheat and store pre-scaled textures to match each change in height position?)

Either way it looks awesome, i want to buy an Nspire just to test :D.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Nspire Raycaster
« Reply #29 on: March 24, 2010, 09:38:33 pm »
I'm using the setPixel() function from the Ndless demo to draw to the screen, which I presume has to refresh the LCD every time it is called.
The array elements are ints.
I assume the setPixel() function writes to the LCD memory, and I know the LCD updates itself automatically when it refreshes. And each pixel is 4 bits, so using ints for the array makes it 8 times as big as it needs to be.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman