Hi,

I try to create TerrainTile with georeference programatically. I have a jpeg 
texture, tiff with heights, and ozi map file with georeference. When I use only 
texture and heght map it`s ok. I can see the terrain, move the camera and place 
objects. But when I try to use georeference file nothing works.

I use gdal library to read ozi map file


Code:

void* transformArg = GDALCreateGenImgProjTransformer(info.data,
                                    info.projectionInfo,
                                    NULL,
                                    info.projectionInfo,
                                    TRUE,
                                    0.0, 1);

    GDALSuggestedWarpOutput(info.data,
                            GDALGenImgProjTransform,
                            transformArg,
                            geoTransform,
                            &pixels, &lines);

    GDALDestroyGenImgProjTransformer(transformArg);

    double minX = std::min(geoTransform[0], 
geoTransform[0]+pixels*geoTransform[1]);
    double minY = std::min(geoTransform[3], 
geoTransform[3]+lines*geoTransform[5]);
    double maxX = std::max(geoTransform[0], 
geoTransform[0]+pixels*geoTransform[1]);
    double maxY = std::max(geoTransform[3], 
geoTransform[3]+lines*geoTransform[5]);

    locator->setTransformAsExtents(minX, minY, maxX, maxY);




and get transform like this:
0.17681 0               0       0
0               0.0693507       0       0
0               0               1       0
30.3104 59.8731 0       1

or if use DegreeToRadiance:

0.00308592      0               0       0
0                       0.0012104       0       0
0                       0               1       0
0.529016                1.04498 0       1

but when I create TerrainTile with this Locator I see only dark line on screen 
and I can't positioning objects or camera by lat,lon,height using this Locator. 
I tryed to use convertModelToLocal(Vec3d(30.487061, 59.873085, 300), local) but 
it returned to me
wrong position.

Thank you!

Cheers,
Sergey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60312#60312





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

Reply via email to