|
@@ -127,9 +127,13 @@ void TestQgs3DRendering::testFlatTerrain() |
|
|
|
|
|
// look from the top |
|
|
scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2500, 0, 0 ); |
|
|
|
|
|
// When running the test on Travis, it would initially return empty rendered image. |
|
|
// Capturing the initial image and throwing it away fixes that. Hopefully we will |
|
|
// find a better fix in the future. |
|
|
Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
|
|
|
QImage img = Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
//QTest::qSleep( 100 ); // a hack to avoid blank render on Travis |
|
|
img = Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
QVERIFY( renderCheck( "flat_terrain_1", img, 40 ) ); |
|
|
|
|
|
// tilted view (pitch = 60 degrees) |
|
@@ -162,9 +166,13 @@ void TestQgs3DRendering::testDemTerrain() |
|
|
engine.setRootEntity( scene ); |
|
|
|
|
|
scene->cameraController()->setLookingAtPoint( QgsVector3D( 0, 0, 0 ), 2000, 60, 0 ); |
|
|
|
|
|
// When running the test on Travis, it would initially return empty rendered image. |
|
|
// Capturing the initial image and throwing it away fixes that. Hopefully we will |
|
|
// find a better fix in the future. |
|
|
Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
|
|
|
QImage img3 = Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
QTest::qSleep( 100 ); // a hack to avoid blank render on Travis |
|
|
img3 = Qgs3DUtils::captureSceneImage( engine, scene ); |
|
|
|
|
|
QVERIFY( renderCheck( "dem_terrain_1", img3, 40 ) ); |
|
|
} |
|
|