Hi all,

I am trying to create a textured object made of several geometries using
different textures but the same vertex array, and I failed to apply textures.

Here is what I do : the object is an extruded building.

I have the footprint of the building - a polygon made of n cartographic points (
X, Y ) -, its height, a texture for the roof, and one texture for each wall.

I create a Vec3Array made of the coordinates of the roof ( x, y, height ),
followed by the coordinates of the ground footprint ( x, Y, 0 ), the size of
this array is 2 * n.

First, I create the roof, a Geometry with a POLYGON PrimitiveSet using the first
n points of the array. I apply the texture to the roof using a n sized texture
coordinates array. 

This works well.

Then, for each wall, I create a Geometry including a TRIANGLES PrimitiveSet.
This one is made of two triangles using for points of the Vec3Array ( the two
triangles of the first wall use points at indices 0, 1, n and n+1 ). 

This works fine.

The problem is when I want to apply textures to the wall. I specify a texture
coordinates for each point and the texture is not applied properly. I have tried
to specify texture coordinates indices - inside the Vec3Array - using
setTexCoordIndixes, but this doesn't work.

Is it possible to share the coordinates array between different textured
geometries and use apply a different texture to each geometry ( roof and walls )
using texture coordinates and texture coordinates indices ?

Any hints or comments ?

Thanks,

___________________________________________________________________________
Frédéric Trastour - [EMAIL PROTECTED] - www.spaceyes.com



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

Reply via email to