wangan2010 发表于 2012-12-17 22:07:03

osgdem无法生成地形,请教各位大侠

今天终于将VPB编译完了,同时也获取了GDAL。
接下来便迫不及待的按照FlySky的方法来生成地形。但是,呵呵,地形根本就没有出来
我的步骤是这样的,命令行依次输入如下:
1、gdal_translate F:\DEM\ps_height_16k.png F:\DEM\ps_height_16k.tif
2、gdaladdo -r average F:\DEM\ps_height_16k.tif 2 4 8 16 32
3、gdal_translate F:\DEM\ps_texture_16k.png F:\DEM\ps_texture_16k.tif
4、gdaladdo -r average F:\DEM\ps_texture_16k.tif 2 4 8 16 32
5、osgdem --xx 10 --yy 10 -t F:\DEM\ps_texture_16k.tif --xx 10 --yy 10 -d F:\DEM\ps_height_16k.tif -l 6 -v 0.1 -o puget.ive -a pegout.osga
(我将下载的到的ps_height_16k.png和ps_texture_16k.png都放入了F:\DEM中,生成的两个tif也放入了这文件夹中。)

但是最终结果却是ive没有生成,osga也是没有生成。只是多了一个名为“puget_root_L0_X0_Y0”文件夹。

请问各位大侠,这到底是怎么回事?

再次对论坛中无私奉献的大侠们表示感谢!

以下是我的命令行的内容:
C:\Users\Administrator>gdal_translate F:\DEM\ps_height_16k.png F:\DEM\ps_height_
16k.tif
Input file size is 16385, 16385
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\Users\Administrator>gdaladdo -r average F:\DEM\ps_height_16k.tif 2 4 8 16 32
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\Users\Administrator>gdal_translate F:\DEM\ps_texture_16k.png F:\DEM\ps_textur
e_16k.tif
Input file size is 16384, 16384
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\Users\Administrator>gdaladdo -r average F:\DEM\ps_texture_16k.tif 2 4 8 16 32

0...10...20...30...40...50...60...70...80...90...100 - done.

C:\Users\Administrator>osgdem --xx 10 --yy 10 -t F:\DEM\ps_texture_16k.tif --xx
10 --yy 10 -d F:\DEM\ps_height_16k.tif -l 6 -v 0.1 -o puget.ive -a pegout.osga
Warning: archive option -a is temporarily disabled, building with archive.
--xx 10
--yy 10
-t F:\DEM\ps_texture_16k.tif
ADD: F:\DEM\ps_texture_16k.tif
loaded layer F:\DEM\ps_texture_16k.tif
--xx 10
--yy 10
-d F:\DEM\ps_height_16k.tif
ADD: F:\DEM\ps_height_16k.tif
loaded layer F:\DEM\ps_height_16k.tif
-o puget.ive
Adding terrainTile
DataSet::_run() 0 0
Now checking for plug-in osgPlugins-3.0.0/osgdb_nvtt.dll
osg::Registry::addImageProcessor(ImageProcessor)
Loaded plug-in osgPlugins-3.0.0/osgdb_nvtt.dll and located ImageProcessor
DataSet::assignDestinationCoordinateSystem() : assigning first source file as th
e destination coordinate system
started DataSet::createDestination(6)
Time for after_reproject 0.000003
DataSet::assignDestinationCoordinateSystem() : assigning first source file as th
e destination coordinate system
local_extents = xMin() 0.000000 163850.000000
                yMin() 0.000000 163850.000000
AR=1.000000 C1=1 R1=1
createNewDestinationGraph
Time for _destinationGraph->computeMaximumSourceResolution() = 0.000252
Time for createDestinationGraph 0.013326
Time for after_computeNeighbours 0.000970
completed DataSet::createDestination(6)
There are 2 contributing source files:
    F:\DEM\ps_height_16k.tif
    F:\DEM\ps_texture_16k.tif
mkpath()
Need to create output task directory = puget_root_L0_X0_Y0
mkpath(puget_root_L0_X0_Y0)
   created directory puget_root_L0_X0_Y0
Task output directory = puget_root_L0_X0_Y0\
started DataSet::writeDestination(puget.ive)
_readRow 1
   reading tile level=0 X=0 Y=0
imageName = puget_L0_X0_Y0.dds
DestinationTile::readFrom(SetName=, FileName=F:\DEM\ps_texture_16k.tif)
DestinationTile::readFrom(SetName=, FileName=F:\DEM\ps_height_16k.tif)
_equalizeRow 1
   equalizing tile level=0 X=0 Y=0
_writeRow 1
DestinationTile::createStateSet() - DataSet::MIP_MAPPING_IMAGERY
Compressed image
called DataSet::decorateWithTerrain()
       getDirectory()=
   writeNodeFile = 0 X=0 Y=0 filename=puget.ive
_writeNodeFile(puget.ive)
Writing out image layer puget_L0_X0_Y0.dds, _directory=
vpb::access(puget.ive, W_OK)=-1
vpb::access(., W_OK)=0

C:\Users\Administrator>osgviewer puget.ive
osgviewer: No data loaded

C:\Users\Administrator>osgviewer pegout.osga
osgviewer: No data loaded

C:\Users\Administrator>

fl_fl_fl_fl 发表于 2013-2-13 00:36:21

和我遇到的问题一样的,我加上--no-mip-mapping就可以了,不知道什么原因

linuxwfgu 发表于 2014-3-17 10:01:13

应该是显卡的问题

zscmeditate 发表于 2015-2-15 16:33:24

fl_fl_fl_fl 发表于 2013-2-13 00:36
和我遇到的问题一样的,我加上--no-mip-mapping就可以了,不知道什么原因

亲测可行

poseidon 发表于 2015-9-12 10:26:39

恩,亲测可行,只是不知道原理是什么?
页: [1]
查看完整版本: osgdem无法生成地形,请教各位大侠