Jump to content

How to computing line-of-sight in IntyBASIC


Recommended Posts

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. :)



  • Like 1
Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...