I stand corrected , well sitting actually :) 

Gordon

__________________________________________________________
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__________________________________________________________

"Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival" 
- Master Tambo Tetsura

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Sébastien 
Guay
Sent: Friday, October 31, 2008 10:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] problem with image

Hi Gordon,

> 2 things
> 
> 1:  osg::Sphere is does not have texture coords so you would not see a 
> texture anyway ( search the archives on Shapes and what they were 
> designed for )

Sorry to enter a thread for this, but yes, osg::ShapeDrawables have texcoords. 
See src/osg/ShapeDrawable.cpp,
DrawShapeVisitor::drawHalfSphere() for the case of an osg::Sphere :

     glNormal3f(-c*nRatioBase,-s*nRatioBase,-nzBase);

     glTexCoord2f(texCoord,vBase);
     glVertex3f(c*rBase,s*rBase,zBase+zOffset);

etc.

It's if you want to *change* the texcoords, or anything else, or do more 
sophisticated things like multitexturing that you'll have trouble with 
ShapeDrawables. I can't argue with the comment that ShapeDrawables are not that 
useful for general use, but for simple things, they're pretty complete 
(including texcoords).

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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to