problem at loading textures

classic Classic list List threaded Threaded
2 messages Options
Latha Latha
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem at loading textures

I am loading texture to load trees using polygons ,but texture is not loading only polygons is loading.I used catalog.xml file to load texture like buildings,myself i wrote xml file but it's not working.can anybody help me what i did mistake in writing xml file otherwise tell how write catalog file for trees,or any otherway to load textures?  Below code i am using load texture using catalog.xml file.
       

code:To load trees
---------------------

 PolygonSymbol* poly = style.getOrCreate<PolygonSymbol>();
 poly->fill()->color() = Color::Green;
AltitudeSymbol* alt = style.getOrCreate<AltitudeSymbol>();
alt->clamping() = alt->CLAMP_TO_TERRAIN;
alt->binding() = alt->BINDING_VERTEX;
StyleSheet* styleSheet = new StyleSheet();
styleSheet->addStyle(style);
ResourceLibrary* reslib = new ResourceLibrary("textures_trees", RESOURCE_LIB_URL1);
RenderSymbol* render = style.getOrCreate<RenderSymbol>();
render->minAlpha() = 0.15f;
FeatureDisplayLayout layout;
layout.tileSizeFactor() = 3.0f;
layout.maxRange() = 2000.0f;
layout.addLevel(FeatureLevel(0.0f, 5000.0f, "parks"));
FeatureGeomModelOptions fgm_opt;
fgm_opt.featureOptions() = feature_opt;
fgm_opt.layout() = layout;
fgm_opt.styles() = styleSheet;
map->addModelLayer(new ModelLayer("parks", fgm_opt));
..........................................................................
xmlfile-code:
--------------

<?xml version="1.0" ?>
<resources name="texlib-us">

  <skin name="L_pic" tags="L_pic">
        <url>D:/RCDT_Train_Simulation/Resources/data/resources/textures_trees/flowr/L_pic.png</url>
        <image_width>27</image_width>
        <min_object_height>50</min_object_height>
        <max_object_height>100</max_object_height>
        <tiled>false</tiled>
    </skin>

</resources>
.....................................................................................






gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem at loading textures

Latha,
If you are trying to texture the sides and top of your extruded polygons, you need a wall style and/or a roof style. Please refer to the code in osgearth_city.cpp / addBuildings() for an example.
Glenn Waldron / Pelican Mapping
Loading...