Shop OBEX P1 Docs P2 Docs Learn Events
Interactive C Raycasting Program w/VGA output — Parallax Forums

Interactive C Raycasting Program w/VGA output

akemp1akemp1 Posts: 2
edited 2014-10-02 06:53 in Robotics
I combined the C-VGA provided with SimpleIDE and this tutorial. Fair warning: it has about a 1 FPS rate and is pretty inefficient. I tried migrating some of the code over to the COGs but I ran into strange registry issues (code seemed to be too large for them).
Anyway, I wanted to see whether the Prop could output 3D graphics in some form and was glad to see that it's possible.
I've used this on my little prop board but it should work on a breadboarded or custom circuit too. I probably won't have enough time to make any major updates after today, but I'd be happy to see if anyone else incorporates it into their project!
It is controlled through the terminal using the 'wasd' keys.
No restrictions on use, btw, though acknowledgement would be nice. :)

Comments

  • ColeyColey Posts: 1,108
    edited 2014-09-29 01:10
    Hi and welcome to the forums.

    Our good friend Baggers did this a few years ago, it's not VGA or C but it is shows how powerful the Prop really is ;-)
  • akemp1akemp1 Posts: 2
    edited 2014-09-30 10:35
    That's very impressive, Coley!
    Anyway, I had a little more time to update my project to work on multiple cores. I'm working on a Senior Design project which will use full duplex serial communication in parallel, so some of what I've learned about the prop architecture will hopefully carry over there. Exploring the multicore design has also given me an appreciation of the absence of interrupts. Now that I've learned how to use volatile variables, it's a lot easier to just shoot off a function and not worry about handling callbacks in the main loop. :)
    Anyway, four of the cores now handle the vertical drawing independently while input is handled by a separate core, allowing faster movement and a much better framerate. Attached is the new project. During debugging I removed the candle effect, though it can be added back.
  • jazzedjazzed Posts: 11,803
    edited 2014-10-02 06:53
    This is a first.

    It's the first time this kind of demo was written entirely in C without requiring any PASM at all for the VGA output.

    Congratulations.
Sign In or Register to comment.