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




Users browsing this thread: 1 Guest(s)