In the initial problem you describe (same texture showing up on all
HeightField instances), it sounds like you are sharing your StateSet between
instances of the HeightField. If you want each to have its own texture,
you'll need a unique StateSet for each HeightField.
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
 


  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wasileski, Bryan
J.
Sent: Tuesday, January 02, 2007 6:03 AM
To: [email protected]
Subject: [osg-users] Texturing


Happy new year all,
 
I'm looking for a little help with texturing. I've not done a much with OSG
so please excuse me if this is all trivial to many of you.
 
I've been working with the HeightField class and I have a program that
sitches together a number of them to create a single surface. The problem
I've been having is that I've been unable to individually texture each
HeightField. They all end up with the same texture (the one that was last
set in the StateSet).
 
I read in an archived email that using HeightFields for terrain type
surfaces was not advisable/optimal. As such I put together some code to
create a HeightField mesh (using the ConvexHull class). I wasn't able to get
the mesh to texture at all.  When looking at the "osgshape" example code I
find that the ConvexHull illustrated there doesn't texture either. Looking
for one more example to go by, I started with the "osgtexturerectangle"
example and I created a couple of GL_QUADS attempting to texture the two
quads differently but only the first received the texture.
 
What I'm looking to do is to create surfaces like the HeightField and
texture them individually. Whether they are HeightField's or
TriangularMesh'es or primitives makes no difference to me- although a height
field is exactly what I'm constructing in my geometry. So I guess what I
need help with is understanding texturing within the context of using the
API. 
 
Thanks in advance for any assistance.
 
 
Bryan
 

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

Reply via email to