<div dir="ltr">Ekaterina,<div>You might try setting your texture border color to transparent.</div><div><br></div><div>texture->setBorderColor(osg::Vec4(0,0,0,0));</div><br>The index in gl_TextureMatrix[1] is the texture image unit; it should match the slot you specified in your call to<div><br>stateset->setTextureAttributeAndModes(1, texMat, osg::StateAttribute::ON);<div><span style="color:rgb(0,0,0);font-family:menlo,monaco,consolas,"courier new",monospace;font-size:16px;white-space:pre-wrap;background-color:rgb(240,240,240)"><br></span></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Glenn Waldron</div></div></div></div>
<br><div class="gmail_quote">On Wed, Dec 21, 2016 at 9:57 AM, Ekaterina Fokina <span dir="ltr"><<a href="mailto:ekaterina.fokina@tum.de" target="_blank">ekaterina.fokina@tum.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am trying to understand how to project a texture on a specific part of the terrain. There are many examples how to project a texture on a whole object, but not to a part of the oblect. That means the question is how to specify texture coordinates (using the shader) on order to project a texture on a right place?<br>
<br>
I have found an examle in internet:<br>
<a href="http://jotschi.de/2009/05/31/projective-textures-with-openscenegraph/" rel="noreferrer" target="_blank">http://jotschi.de/2009/05/31/<wbr>projective-textures-with-<wbr>openscenegraph/</a><br>
<br>
But unfortunatelly, It is not working properly and I can see my projection on the terrain, but the rest of it is black.<br>
<br>
One more question, does anybody can explain to me what is the difference between the numbers in gl_TextureMatrix[0...7]?<br>
<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Ekaterina<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=69726#69726" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=69726#<wbr>69726</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br></div>