Hi,
On 01/06/10 10:45, alessandro terenzi wrote:
Do you want to create an application that takes the model and output
a new model? Or do you want to create something that changes the
model at input time in an application?
Well, I need to change the model just once before using it (I mean I
could either show it in a viewer or save it to disk) in both cases I
just need to replace the texture that has no alpha information with the
one that actually has it.
Do you want to fuse two textures together (one with image info and
one with alpha info)?
No, just replace the one without alpha with the new one.
Maybe it uses Windows API just for windowing and you can look at the
conversion code?
Actually that code is very simple because it uses a class (Bitmap) that
let you access each pixel R,G,B and alpha values...so the code performs
a simple loop that updates the alpha value with a mean of R,G and B values.
OK, following could work then:
1) get data into osg::Image (RGB), either by loading directly from disk,
if you can, or getting from texture using visitor/RTT.
2) create new osg::Image (and allocate memory) with same size as
original, but with alpha channel.
3) Do the conversion using pointers to the data. Data is stored e.g.
RGBRGBRGB... or RGBARGBARGBA...
4) change texture format to RGBA and call setImage with new image.
jp
Alessandro
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org