View Full Version : noob / paint pixels?
04-28-2004, 10:23 AM
on a given polygon, is it possible to "paint" individual pixels?
I know we can make a polygon a given color, but can it be "painted", at the pixel level as in a 2d paint program?
any pointers to information on this topic appreciated
04-28-2004, 10:33 AM
uh ? glDrawPixels ?
Or texturing ?
05-05-2004, 04:24 PM
Yes it is possible, there are many ways. You may just need typical texturing, however if you're describing exactly what you want accurately something like eyespace texgen (with a projective coordinate or texture matrix) could accomplish this, as could stencil operations, zbuffer operations or destination alpha buffer operations in conjunction with drawpixels.
The eyespace texgen would be the simplest approach and only require the rendering of the polygon once with no significant complications.
05-05-2004, 04:40 PM
In my humble interpretation I believe you want to move a textured polygon around, click on the screen and use some kind of brush to update the texture.
If it is, you can use something like gluUnproject to find out which 2D texture pixel corresponds to the picked screenpoint, update the colorvalue of that pixel in the texture array of your program and reload the updated texture to video memory using TexImage or SubTeximage(faster).
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.