+DZ-Jay Posted April 9 Share Posted April 9 I need to compute line-of-sight and I thought that the simplest way would be to use raycasting: to "plot" a line from the source to target objects and test for obstacles on the way. If the obstacles are encoded in BACKTAB cards, then instead of "plotting" pixels, we "plot" background cards, which would be cheaper Does anybody have a better way? By the way, does anybody have a fast implementation of Bresenham's Line-Drawing Algorithm in IntyBASIC? I found a few in C that I could try porting, but my C-to-IntyBASIC porting skills are a bit lame, so I thought I would ask first. -dZ. 1 Quote Link to comment Share on other sites More sharing options...
carlsson Posted April 9 Share Posted April 9 I made a Bresenham inspired "game" in Sinclair BASIC six years ago, but since that routine is based on floating point numbers which IntyBASIC to most part lacks, it is no point for me to try to port it, as you'd just as well port any routine in a pseudo language like C. bresenham.zxbas 1 Quote Link to comment Share on other sites More sharing options...
artrag Posted April 17 Share Posted April 17 There is an incredible implementation in ASM of a raytracing demo on this forum. You can study its DDA algorithm to implement lines (of use as reference something like this https://www.geeksforgeeks.org/dda-line-generation-algorithm-computer-graphics/) 1 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted April 17 Author Share Posted April 17 1 minute ago, artrag said: There is an incredible implementation in ASM of a raytracing demo on this forum. You can study its DDA algorithm to implement lines (of use as reference something like this https://www.geeksforgeeks.org/dda-line-generation-algorithm-computer-graphics/) Thanks, I had forgotten about that demo. I'll seek it out. By the way, it turns out I didn't need to implement Bresenham's straight out, since a simple DDA worked for my game due to its implementation of motion vectors. dZ. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.