Hello Victor,

Victor Haefner wrote:
> So first the geometry :
> 
> I have two rings of N vertices indexed 0 to N-1 for the first and N to 
> 2N-1 for the second
> 
>   1     *-----------------*   4
>        /                  /  \
>      /      * 2          /_-*    5
> 0  *--------------------*      
>                         3

ok, this is very helpful, thanks! (just a minor remark: ASCII art works 
better with plain text email instead of HTML mail as the former is 
normally always shown with a monospace font).

> here the inexing for the quads :
> 
>                 indices->addValue(vertexlist[j]->index);
>                 indices->addValue(vertexlist[j+1]->index);
>                 indices->addValue(vertexlist[j+1]->index);
>                 indices->addValue(vertexlist[j]->index);
> 
> and for the last quad :
> 
>                 indices->addValue(vertexlist[j]->index);
>                 indices->addValue(vertexlist[0]->index);
>                 indices->addValue(vertexlist[0]->index);
>                 indices->addValue(vertexlist[j]->index);
> 
> this gives the following array : 0143 1254 2035
> those are the correct quads
> ..this all works fine, but now I want a texture all around the tube
> Carsten wrote :
> 
>     It seems you want to use a vertex just once, but give it two different
>     texture coordinates? You can store the vertex position once and use
>     different indices for position and texture coordinate to get something
>     similar, i.e. one position *used* twice, each time with a different tex
>     coord.
> 
> 
> that would be perfect :) ..but how can I do that? this is my first 
> selfmade geometry (except for the water of the tutorial) I realy could 
> need some code examples ^^

depending on which version of OpenSG you are using (1.x or 2.0) please 
take a look at
<http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Geometry#MultiIndexedGeometry>
 

or
<http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG2/Geometry#MultiIndexedGeometry>.
It explains a bit how you can have different indices for positions and 
tex coords. The other alternative is to simply repeat the vertex position.
Also, Tutorials/07multiindexgeometry.cpp (for 1.x) or 
Examples/Simple/07multiindexgeometry.cpp (for 2.0) might be interesting 
as examples, who it works in practice.

> There exist other methods for texturecoords like setTexCoords1 or 
> setTexCoords2 etc.. what are they for? could they be usefull here?

for objects with more than one texture you can have also more than one 
set of texture coordinates, these functions simply set these.

        Cheers,
                Carsten


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to