Raycasting, but not sending a ray step by step?

Blitz3D Forums/Blitz3D Programming/Raycasting, but not sending a ray step by step?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes! Use a binary search: First do a step that is 50% of the max distance you want to cast. Picked something? (Where picking could be a simple raycasting algorithm, doesn't have to be a 3D LinePick). Well if you picked something then check 25% of the max distance (if there was nothing, try 75% !). Then continue this binary search by dividing the remaining rest of the unchecked zone by 2: 50%,75%(or 25%), 87.5%, 93.75%...... This way you'll have a 32 Bit accuracy with a max of 32 Steps, be it int or float.

BTW have a look at my raycasting flight simulator, that features hills (just like stairs) in the archives.