<div dir="ltr">Hi Aaron,<div><br></div><div>I would do this with texture atlas - all roofs in one large texture and map them separately. This is sort of common in database development</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 29, 2015 at 11:14 PM, Aaron Andersen <span dir="ltr"><<a href="mailto:aaron@fosslib.net" target="_blank">aaron@fosslib.net</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>
Consider if I have a mesh file constructed from 2 geometries: a cube, and a pyramid on top of the cube, representing a simple house. When I load this house it is pulled into OSG as a single Geode composed of 2 Geometry instances.<br>
<br>
I have 2 image files for this house: a brown brick house texture and a black shingle texture which can be applied to the 2 geometries of the house mesh. Now consider if I have 2 more textures: a dark grey vinyl siding texture, and a dark green metal roof texture. If I keep producing more image files you can imagine all the different possibilities I might have in constructing a home.<br>
<br>
Now consider if I want to make a row of 25 houses:<br>
<br>
osg::Group * rootOfScene = new osg::Group;<br>
<br>
osg::Node * houseGeode = osgDB::readNodeFile("house-mesh.ext");<br>
<br>
for (int i = 0; i < 25; i++)<br>
{<br>
osg::PositionAttitudeTransform * transform = new osg::PositionAttitudeTransform;<br>
<br>
transform->setPosition(osg::Vec3d(i * 20.f, 0, 0));<br>
transform->addChild(houseGeode);<br>
<br>
rootOfScene->addChild(transform);<br>
}<br>
<br>
What is the most efficient way to apply these different texture sets so that I can have a row of houses, each with different textures being applied to the cube mesh and the pyramid mesh?<br>
<br>
Any help is greatly appreciated.<br>
<br>
Thank you,<br>
Aaron<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">trajce nikolov nick<br></div>
</div>