Commit 9b0dc269 authored by Jan Möbius's avatar Jan Möbius

Import color from Height map as per vertex colors

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20212 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 832965f4
......@@ -170,7 +170,8 @@ void FileHeightFieldPNGPlugin::loadImageAsTriangleMesh(QImage& _image,TriMesh* _
const QColor currentColor = _image.pixel(i,j);
double value = std::max(currentColor.redF(),currentColor.blueF());
value = std::max(currentColor.greenF(),value);
_mesh->add_vertex(TriMesh::Point(i,j,-value * _height));
TriMesh::VertexHandle vh = _mesh->add_vertex(TriMesh::Point(i,j,-value * _height));
_mesh->set_color(vh,TriMesh::Color(currentColor.redF(),currentColor.greenF(),currentColor.blueF()));
}
}
......
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