Commit 917d983b authored by Frédéric Larue's avatar Frédéric Larue

Minor improvement in the display of the MetricGrid.

parent bc5e99c3
......@@ -20,15 +20,16 @@ void MetricGrid::displayGrid( GLViewer *viewer,
{
const QVector3D camCenter = viewer->viewpointLocation();
const QVector3D camFront = viewer->viewRotationMatrix().row(2).toVector3D();
const QVector3D camView = camCenter.normalized();
const double spacing2 = 2.0 * spacing;
const double step = 0.1 * spacing;
float alphaX = 1.0f - std::abs(camFront.x());
float alphaX = 1.0f - std::abs(camView.x());
alphaX = std::max( 0.0f, std::min( 1.0f, (alphaX-0.025f)*10.0f ) );
float alphaY = 1.0f - std::abs(camFront.y());
float alphaY = 1.0f - std::abs(camView.y());
alphaY = std::max( 0.0f, std::min( 1.0f, (alphaY-0.025f)*10.0f ) );
float alphaZ = 1.0f - std::abs(camFront.z());
float alphaZ = 1.0f - std::abs(camView.z());
alphaZ = std::max( 0.0f, std::min( 1.0f, (alphaZ-0.025f)*10.0f ) );
// Display the points representing the current grid scale.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment