Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fun with Ray Casting
#11
(01-16-2025, 06:20 PM)MasterGy Wrote: Sorry, I don't want to trash your code Smile I just got carried away because I really like it and studied it a bit.
If you rewrite this in 'Renderframe', the landscape will darken proportionally to the distance and improve the 3d experience a bit. The bigger the ".001", the bigger the effect. At ".01" it's like walking at night with a flashlight.

Code: (Select All)
 
If heightOnScreen < hiddenY(i) Then
  Dim col As Long
  col = map(MAP_COLOR, mapPos.x, mapPos.y)
  Dim multi As Single
  multi = 1 - Abs(z) * .001
  Line (i, heightOnScreen)-(i, hiddenY(i)), _RGB32(_Red(col) * multi, _Green(col) * multi, _Blue(col) * multi)
  hiddenY(i) = heightOnScreen
End If

Thanks! Glad you like it.

No worries. That's a solid tip which I am going to shamelessly steal.  Big Grin
Reply


Messages In This Thread
Fun with Ray Casting - by a740g - 01-13-2025, 01:33 AM
RE: Fun with Ray Casting - by Bhsdfa - 01-13-2025, 01:45 AM
RE: Fun with Ray Casting - by a740g - 01-15-2025, 02:36 AM
RE: Fun with Ray Casting - by SierraKen - 01-15-2025, 06:52 PM
RE: Fun with Ray Casting - by NakedApe - 01-15-2025, 07:45 PM
RE: Fun with Ray Casting - by a740g - 01-16-2025, 11:16 AM
RE: Fun with Ray Casting - by Petr - 01-15-2025, 08:02 PM
RE: Fun with Ray Casting - by a740g - 01-16-2025, 11:21 AM
RE: Fun with Ray Casting - by MasterGy - 01-16-2025, 04:24 PM
RE: Fun with Ray Casting - by MasterGy - 01-16-2025, 06:20 PM
RE: Fun with Ray Casting - by a740g - 01-17-2025, 05:50 AM



Users browsing this thread: 1 Guest(s)