Hi,

i just wanted to say that it worked fine and fast.
I not used 2^n sized images, but setScale(false)
and calculated a suitable TransformationMatrix for the TextureTransformChunk to have the whole geometry covered.

Tanks,
        Daniel
   Hi Daniel, hi Andreas,


// Change image and texture.
unsigned int *dst = (unsigned int *) _image->getData();
// now copy some pixels into the image
*dst++ = ...

beginEditCP(image);
endEditCP(image);


Hmm, not a perfect example. You should call beginEditCP before the
changes, as it might have to create a separate copy of the data for the
aspect. If you do it afterwards it might fail, because you changed te old
version of it.


beginEditCP(xchunk, TextureChunk::ImageFieldMask);
xchunk->imageContentChanged();
endEditCP(xchunk, TextureChunk::ImageFieldMask);

I use this kind of code for a video texture. The image should have a
size of 2^n!


You can use non-2^n textures if you call setScale(false) on the
TextureChunk. In that case the image will only fill the lower left part of
the next bigger 2^n texture and will not be scaled (which takes forever,
as it uses gluScaleImage). You will have to adjust your texture
coordinates accordingly, or use a TextureMatrixChunk to correct for the
texture only being partially used.

Hope it helps

    Dirk



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users


--
Why do blondes have more fun?

     Because they don't know any better.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to