3d paint

Started by
0 comments, last by illume 21 years, 11 months ago
I''ve been experimenting with 3d painting recently, as I plan to make an open source 3d painter. But have come into trouble with an approach I''m using. I was generating an image where each pixel has a unique color. Then drawing the mesh using this unique image as the texture. The idea was to then glReadPixels and find the color where the mouse is, then search for this color on the unique texture. This way finding the uv coordinates for where the mouse was clicked( the place on the texture the user plans to paint). However it turns out that the color returned is not quite what it should be. I have disabled GL_BLEND, GL_DITHER, GL_FOG, GL_LIGHTING, so that they may not make the color of my choosing different. To stop interpolation of the texture I have used: glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST) glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST) I have set glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) None of this seems to work, so I fear the worst. Can someone please help me in this, with suggestions on how to fix this problem or to suggest another method?
Advertisement
possibly you lost somehwere precision with for example 16bit colormode, or 16bit texturecolormode, dunno..

you using GL_RGB8 for glTexImage2D or 3 at the... 3rd? parameter..

have no other idea, but my brain is not working properly caused by the fever currently.. possibly i have more tips when its away in some days..

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement