Hello Julia,

Code:
geometry->setTexCoordArray(1, geometry->getTexCoordArray(0));
I cant do this because my drawable does not inherit from osg::Geometry, but is 
something manual like this needed for non-zero textures?

Well, there you have it, you need texture coordinates for unit 1 if you want to get any predictable effect from setting a texture on unit 1.

Is your drawable a ShapeDrawable? Then you're pretty much out of luck, because these only set texture coordinates on unit 0 and don't give you access to their internals. I suggest you go into a modeling program, create (say) a sphere of diameter 1 (if what you want is a sphere, if not do the same for another type of object), export that and load it in your program instead of using ShapeDrawables. Then they will be instances of osg::Geometry (which you'll have to find with a visitor) and you'll be able to use the code above to copy texture coordinate arrays. If you use diameter of 1 you can then scale it with a MatrixTransform and get predictable results.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to