PDA

View Full Version : Color detection



gokugohan
03-25-2013, 02:19 PM
Hi guys
I have make some simple maps with glrect(...) with colors and i create also one sphere to walk on the map from one direction to another, i want my sphere detect what color is glrect() so i cant control and restrict how my sphere should move in map created. Please help, because what i just know for color detection is with mouse and i dont want it, because i will move the sphere with keyboard.

Thanks

carsten neumann
03-26-2013, 12:17 PM
Hmm, I must be misunderstanding something, but if you know how to determine the color at the mouse' position, what is the difference to determining the color at the sphere position?
Besides, if your map consists of colored rectangles can't you use the rectangles coordinates and the sphere center to calculate which rectangle you are in?