Skip to content

Commit

Permalink
[pointclouds] Don't prematurely convert point coordinates to float va…
Browse files Browse the repository at this point in the history
…lues

(and then convert immediately convert them back to doubles)

This causes unwanted rounding of the coordinates before Qgs3DUtils::mapToWorldCoordinates
has been able to apply the correction for the map's origin

Ultimately fixes vertical "banding" effects seen in some point clouds
  • Loading branch information
nyalldawson authored and PeterPetrik committed Dec 7, 2020
1 parent 04b9c6a commit b915c7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/3d/symbols/qgspointcloud3dsymbol_p.cpp
Expand Up @@ -270,7 +270,7 @@ void QgsSingleColorPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *p
double x = offset.x() + scale.x() * ix;
double y = offset.y() + scale.y() * iy;
double z = offset.z() + scale.z() * iz;
QVector3D point( x, y, z );
QgsVector3D point( x, y, z );
QgsVector3D p = context.map().mapToWorldCoordinates( point );
outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) );
}
Expand Down Expand Up @@ -370,7 +370,7 @@ void QgsColorRampPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc,
double x = offset.x() + scale.x() * ix;
double y = offset.y() + scale.y() * iy;
double z = offset.z() + scale.z() * iz;
QVector3D point( x, y, z );
QgsVector3D point( x, y, z );

QgsVector3D p = context.map().mapToWorldCoordinates( point );
outNormal.positions.push_back( QVector3D( p.x(), p.y(), p.z() ) );
Expand Down Expand Up @@ -471,7 +471,7 @@ void QgsRGBPointCloud3DSymbolHandler::processNode( QgsPointCloudIndex *pc, const
double x = offset.x() + scale.x() * ix;
double y = offset.y() + scale.y() * iy;
double z = offset.z() + scale.z() * iz;
QVector3D point( x, y, z );
QgsVector3D point( x, y, z );
QgsVector3D p = context.map().mapToWorldCoordinates( point );

QVector3D color( 0.0f, 0.0f, 0.0f );
Expand Down

0 comments on commit b915c7a

Please sign in to comment.