Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit c0fe9f70 authored by Jakob Weiss's avatar Jakob Weiss

Fixed ProxyGeometryGenerator Clipping

parent 32f1e91d
......@@ -429,7 +429,7 @@ namespace campvis {
}
// add top center vertex
MultiIndexedGeometry::index_t topVertexIndex = vertices.size();
MultiIndexedGeometry::index_t topVertexIndex{ static_cast<MultiIndexedGeometry::index_t>(vertices.size()) };
vertices.push_back(cgt::vec3(0.f, 0.f, 1.f));
normals.push_back(cgt::vec3(0.f, 0.f, 1.f));
// add rest of top vertices
......
......@@ -62,8 +62,10 @@ namespace campvis {
if (img != 0) {
if (img->getDimensionality() == 3) {
std::unique_ptr<MeshGeometry> cube = GeometryDataFactory::createCube(cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f)), cgt::Bounds(cgt::vec3(0.f), cgt::vec3(1.f))
, img->getMappingInformation().getTextureToWorldMatrix());
cgt::vec3 start = cgt::vec3(cgt::ivec3(p_clipX.getValue().x, p_clipY.getValue().x, p_clipZ.getValue().x)) / cgt::vec3(img->getSize());
cgt::vec3 end = cgt::vec3(cgt::ivec3(p_clipX.getValue().y, p_clipY.getValue().y, p_clipZ.getValue().y)) / cgt::vec3(img->getSize());
std::unique_ptr<MeshGeometry> cube = GeometryDataFactory::createCube(cgt::Bounds(start, end), cgt::Bounds(start, end));
cube->applyTransformationToVertices(img->getMappingInformation().getTextureToWorldMatrix());
data.addData(p_geometryID.getValue(), cube.release());
}
else {
......
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