Circular Magnification - Sniper Scope
I'm hoping to make a sniper-esque game. The background is far away and when the mouse (scope) is over a certain area, then that area is enlarged. A subimage method call would work well for that... But heres the catch, a sniper scope is ROUND not square. How can I capture the subimage and then filter out the parts of the image that are not in the circular scope?
Thanks for any help or ideas.
# 1
I can tell you how'd i go about doing it with jogl
I assume with is a first person game. When not in scope mode, have the camera where the sniper's head would be.
When in-scope...translate the camera toward the line of sight in accordance with your zoom. Draw all the objects like normal, then draw the scope outline over it...basically a square as big as the screen, but with a snipe scope circle cut out in the middle.
I've noticed thats how Battlefield 2 does it ;)
Anyways, hope that helps.
David
# 7
Draw the rectangular area. Then draw the inverse of the circle in black. Alternatively, if you want the area outside the circle to be the unzoomed image, you'll probably want two buffers. Draw zoomed and unzoomed to different ones, then copy circular area.