Skip to main content
gamedev.net
🔒 Locked

lens effect

Started by fakemind Dec 23, 2001 at 12:06 AM 0 replies 600+ views
Original Post
fakemind
fakemind
you know that windows screensaver that looks like theres a magnifying glass over your screen and it moves around, i think its called something like the "lens effect" or whatever. i read a tutorial on it once that said it was just a square that each pixel was pre-calculated of what pixel it would be underneath it. (i hope im making sense). well, this is all good and fine, but i wanted to create something similar to it in my game. they said they precalculated theirs using sin() and whatever. well, i wanted to create one, but instead of a filled-in-circle, i wanted a circle thats not filled in. ex: just the outline of the circle is the "magnifying glass". anybody know how to go about doing this? oh, and the only way i could think of drawing such a thing would be to copy whatever is underneath our potential lens to a bitmap of the same size. then when you draw the "lens" you could do something like: // *under[..] is bitmap of whats underneath // *new[..] is whats going to be drawn in its place // *lens[..] contains the index from "under" to be put in "new" for ( i = 0; i < WHATEVER_SIZE; i++ ) { new = under[ lens[ i ] ]; } would that be the best way to go about it? (besides drawing to the actual screen instead of to "new" then to the screen.) thanx - jeremiah http://fakemind.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.