View Full Version : picture viewer with lens

03-24-2004, 12:44 AM
I made a soft wich load an picture, and show it.
But I want have a lens(fisheye lens) that follow my mouse cursor.
So, I think to subdivise my textures in 1*1*1 pixels triangles and make translate on those vertex.
But for 800*600 pictures, there are ~1 millions triangles to draw !
Is there a better solution (draw the entire picture + made a grid only for the lens...) ?

03-24-2004, 05:35 AM
You might be able to take your picture and map it to a sphere (or half sphere if you desire) using environment mapping. That would definately be faster than drawing ~1 million triangles. I can't remember the exact procedure, so I took a look online for some tutorials:

Sphere environment mapping (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=23)
Cube environment mapping (http://developer.nvidia.com/object/IO_20010830_4778.html)