From Luc Fruciel, "Gdal plugins reads lots of information that is not taken into account in ReadHeigthField for example.
Attached a modification that read the HeigthField position and X,Yintervals. I also removed the limitation to 1024*1024 to 4096*4096, because when you are preprocessing your data with OSG, it can be useful to read large images/heigthfields. Is there a reason (other than hardware limitations for textures) for this limit ?"
This commit is contained in:
@@ -76,8 +76,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
|
||||
int destX = 0;
|
||||
int destY = 0;
|
||||
int destWidth = osg::minimum(dataWidth,1024);
|
||||
int destHeight = osg::minimum(dataHeight,1024);
|
||||
int destWidth = osg::minimum(dataWidth,4096);
|
||||
int destHeight = osg::minimum(dataHeight,4096);
|
||||
// int destWidth = osg::minimum(dataWidth,4096);
|
||||
// int destHeight = osg::minimum(dataHeight,4096);
|
||||
|
||||
@@ -530,8 +530,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
|
||||
int destX = 0;
|
||||
int destY = 0;
|
||||
int destWidth = osg::minimum(dataWidth,1024);
|
||||
int destHeight = osg::minimum(dataHeight,1024);
|
||||
int destWidth = osg::minimum(dataWidth,4096);
|
||||
int destHeight = osg::minimum(dataHeight,4096);
|
||||
|
||||
osgDB::ImageOptions::TexCoordRange* texCoordRange = 0;
|
||||
|
||||
@@ -711,7 +711,9 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter
|
||||
hf->setHeight(c,copy_r,temp);
|
||||
}
|
||||
}
|
||||
|
||||
hf->setOrigin(osg::Vec3(BottomLeft[0],-BottomLeft[1],0));
|
||||
hf->setXInterval((BottomRight[0]-BottomLeft[0])/destWidth);
|
||||
hf->setYInterval((TopLeft[1]-BottomLeft[1])/destHeight);
|
||||
return hf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user