Hello Vincenzo,

Vincenzo Marafioti wrote:
> i need to get  u, v, s, t  texture coordinate value from a triangle 
> iterator. I tried to do as shown below:
> 
>     for(; triIt != triEnd; ++triIt){   
>         //for every vertex of the triangle
>         for(int v=0;v<3;v++, i++){
>             vec2f  t0  = triIt.getTexCoords(v)
>             vec2f  t1  = triIt.getTexCoords1v)
>             vec2f  t2  = triIt.getTexCoords2(v)
>         }
>     }
> 
> But the triangle iterator methods avaliable do not directly allow me to 
> get all the 4 components. I should use the geometry index I think, do 
> you have any idea about?

GeometryPtr geo;
GeoTexCoords4fPtr tcoords =
     GeoTexCoords4fPtr::dcast(geo->getTexCoords());
const GeoTexCoords4f::StoredFieldType *tc = tcoords->getFieldPtr();

Vec4f t0 = (*tc)[triIt.getTexCoordsIndex(0)];
Vec4f t1 = (*tc)[triIt.getTexCoordsIndex(1)];
Vec4f t2 = (*tc)[triIt.getTexCoordsIndex(2)];

        Cheers,
                Carsten

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to