Author Topic: Optics  (Read 16320 times)

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Optics
« Reply #60 on: October 08, 2005, 01:57:45 AM »
but what about if bots want to display colors other bots are not supposed to be able to see?
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Optics
« Reply #61 on: October 08, 2005, 11:36:32 AM »
We would just need to implement a "color window" for bots.  Basically ranges of colors the bot can see.

Oh, and to handle the intensity problem:

imagine each bot has a "base" color.  This can be represented by a 3 part vector (RGB).    To determine the new color of the reflected light and its intensity such and such far away, you'd do:

Divide RGB by 255.  This is now the percentage of each color that the bot reflects.

Determine the light level where the bot is.  That light intensity * RGB = color and intensity of reflected light  (You could also multiply light intenisty by another %age color vector, for colored light in the sim).

Say a bot can see this new bot.  Well, the colors it sees is our previous vector scaled back for the distance the light has had to travel from the reflecting bot to the seeing bot.

If all elements of our new RGB vector are visible to the seeing bot's window, then it can see that bot.

The only thing missing from that equation is consideration for the size of the reflecting bot.  Small things seen far away are invisible basically (RGB = <0,0,0>)