Revealing where units have been.
by Nathan Bowhay - ESAL · in Technical Issues · 11/16/2006 (10:51 am) · 0 replies
I need to create a minimap that reveals where the player has been.
HOWEVER, the entire map needs to be shown at all times. In other words I want the map to have a faded low contrast look (like a grey image was placed over it and the opacity lowered). Then as the player moves around the map I want a higher contrast color trail to appear where the player has been. So it is visible where the player has been and also where it is going.
There is a forum post were they only drew certain parts of the minimap image, but I want everything to show.
I also thought of storing an array of pixels (Array[width,height]) then using glPoint to draw over the image. This would require (at least) two for loops and that is x^2 witch is really hard on the machine.
I then though what if I had another image over the top and do some sort of mask. Take two bitmap images and layer the low contrast image over the high contrast image. and then set the opacity of the low contrast images pixels to 0 where the unit travels. (a lot like having 2 layers in photoshop and erasing the top one)
I have not done something like this before in OpenGL but I am approaching an intermediate level in OpenGL, and feel I am up to the challenge.
If someone could point me in the right direction it would be greatly appreciated.
HOWEVER, the entire map needs to be shown at all times. In other words I want the map to have a faded low contrast look (like a grey image was placed over it and the opacity lowered). Then as the player moves around the map I want a higher contrast color trail to appear where the player has been. So it is visible where the player has been and also where it is going.
There is a forum post were they only drew certain parts of the minimap image, but I want everything to show.
I also thought of storing an array of pixels (Array[width,height]) then using glPoint to draw over the image. This would require (at least) two for loops and that is x^2 witch is really hard on the machine.
I then though what if I had another image over the top and do some sort of mask. Take two bitmap images and layer the low contrast image over the high contrast image. and then set the opacity of the low contrast images pixels to 0 where the unit travels. (a lot like having 2 layers in photoshop and erasing the top one)
I have not done something like this before in OpenGL but I am approaching an intermediate level in OpenGL, and feel I am up to the challenge.
If someone could point me in the right direction it would be greatly appreciated.