Thank you so much Robert that was exactly what I needed!!
I'm a little bit ashamed of my poor knowledge of OpenGL.....
Regards

On Tue, Nov 18, 2008 at 4:29 PM, Robert Osfield <[EMAIL PROTECTED]>wrote:

> Hi Simon,
>
> The normal way to manage this situation is to simple update the
> geometry and tex coords as required.  Now if you are wanting to
> stricty use transforms to scale your geometry then you'll need to
> something similar for your tex coords and luckily that is an OpenGL
> feature for doing scaling - the texture matrix.  To access this just
> use the osg::TexMat state attribute, use a similar scale as you are
> using for your transform.  You can attach a StateSet with a TexMat to
> the same Transform that you are using for scaling.  The one caveat is
> that it'll apply to whole subgraph you are decorate the TexMat with so
> you might need to think about localising multiple TexMat for different
> surfaces.
>
> Robert.
>
> On Tue, Nov 18, 2008 at 3:13 PM, Simon Loic <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I have a particular problem that I got no idea how to solve it. Here it
> is:
> >
> > When I am scaling a drawable ( using a transform node ) the texture
> attached
> > to it is stretched. Obviously this behaviour is totally convenient for
> many
> > applications. Though, I am working on architecture and this behaviour is
> > really troublesome. You can imagine for example that the Drawable
> represent
> > a rectangle piece of wall and the texture contains a brick pattern of
> > dimension 1 meter over 1 meter.  Then if I scale the Drawable to have 10m
>  x
> > 15 m the Texture will stretched to fit this size.
> >
> > To my mind the only way to achieve what I want is to compute new texture
> > coordinates from the ones of the Drawable and 2 scaling parameters (let's
> > say sX and sY).
> > Even if this is not theoretically difficult I don't have a sufficient
> > knowledge of OSG to tell if it's already possible without embedding osg
> with
> > a new feature, or otherwise how to optimally extend osg to support this
> kind
> > of behaviour.
> >
> > If anyone understand what I'm trying to do, I will be so grateful for
> your
> > help
> > regards.
> >
> > --
> > Loïc Simon
> >
> > _______________________________________________
> > 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
>



-- 
Loïc Simon
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to