diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index 02f9857a9f0..7dfbbe3900e 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -3520,10 +3520,10 @@ pcl::visualization::PCLVisualizer::addTextureMesh (const pcl::TextureMesh &mesh, std::size_t tex_id = 0; while (tex_id < last_tex_id) { -#if VTK_MAJOR_VERSION > 5 - const char *tu = mesh.tex_materials[tex_id].tex_name.c_str (); -#else +#if VTK_MAJOR_VERSION < 8 int tu = vtkProperty::VTK_TEXTURE_UNIT_0 + tex_id; +#else + const char *tu = mesh.tex_materials[tex_id].tex_name.c_str (); #endif vtkSmartPointer texture = vtkSmartPointer::New ();