Hi Paul,

thanks for your help. I have 16 vertices. How has the array to look like
if I want to assign only 4 vertices to my texture and the other vertices
not ?

+---+---+---+
| T |   |   |
+---+---+---+
|   |   |   |
+---+---+---+
|   |   |   |
+---+---+---+

My array looks like this and of course, it produces not what I want:

osg::Vec2Array* texcoords = new osg::Vec2Array(16);
   (*texcoords)[0].set(0,0);
   (*texcoords)[1].set(1,0);
   (*texcoords)[2].set(0,0);
   (*texcoords)[3].set(0,0);
   (*texcoords)[4].set(0,1);
   (*texcoords)[5].set(1,1);
   (*texcoords)[6].set(0,0);
   (*texcoords)[7].set(0,0);
   (*texcoords)[8].set(0,0);
   (*texcoords)[9].set(0,0);
   (*texcoords)[10].set(0,0);
   (*texcoords)[11].set(0,0);
   (*texcoords)[12].set(0,0);
   (*texcoords)[13].set(0,0);
   (*texcoords)[14].set(0,0);
   (*texcoords)[15].set(0,0);

But how can I reach this goal, that only the upper left corner got its
texture?


Thanks again.


Michael


> The short answer is that it looks the same. :-) OSG assigns each texture
> coordinate in your array to each vertex in your array. So if you have four
> vertices, then it looks like your example below, but if you have 16 vertices
> then you need 16 texture coordinates in your texture coordinate array.
> 
> Hope that helps,
>    -Paul
> 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of 
> > Michael Aulhorn
> > Sent: Tuesday, February 13, 2007 9:42 AM
> > To: osg users
> > Subject: Re: [osg-users] multiple textures and one geometry
> > 
> > Hi Robert,
> > 
> > thanks for your help. My Problem is, I don't know exactly how 
> > the coord. array hast to look like. To apply one texture to 
> > the hole geometry it looks this way:
> > 
> > osg::Vec2Array* texcoords = new osg::Vec2Array(4);
> >    (*texcoords)[0].set(0.0f,0.0f);
> >    (*texcoords)[1].set(1.0f,0.0f);
> >    (*texcoords)[2].set(1.0f,1.0f);
> >    (*texcoords)[3].set(0.0f,1.00f);
> > 
> > How does it look like if I wan't to use a texture for 
> > specific vertices ?
> > 
> > Michael


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to