PDA

View Full Version : Resize after drawing points with glVertex



JackR
05-14-2008, 08:30 AM
Hello all,

I use glVertex to draw entire images, pixel by pixel, using pixel intensity information that I get from source data. The source data is a listing of pixel intensity and position (not an image). This works fine if the size of the image I want to draw is the same as the original data, but if I enlarge the window, I am left with blank space between pixels.

Does anyone have any suggestions as to what I can do to rezise my image and still have it appear complete?

Thanks,
Jack

ZbuffeR
05-14-2008, 09:30 AM
If your data is ordered in line/columns, just create a texture of it : instant bilinear filtering !

Apparently it is not, so you have to use a different way of interpolation.
One possible way is to build a 2d surface out of your points, using delaunay triangulation : you will get linear color interpolation between vertex.
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/quake/public/www/triangle.html

147-2
05-16-2008, 10:47 AM
you can create quads out of your points, then when the image is scaled the quads will scale with it. You can also do as Z says, and create the image as a texture... I think I'd rather do what Z says.