Quantcast

pcl::TextureMapping function help

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

pcl::TextureMapping function help

futy
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hello: Could anyone be able to explain the meaning of the setF and setVectorField functions in pcl :: TextureMapping?

the pcl version is 1.7.2

the Texture file is:
https://1drv.ms/i/s!Agj0RQz5HUq8g3M9efUCnKjJlUmN


the point cloud data is:

https://1drv.ms/i/s!Agj0RQz5HUq8g3Z9-VryThF4JtdT




and the code is:


double fv = 1;
double fx = 1 , fy = 0, fz = 0;
pcl::TextureMapping<pcl::PointXYZ> tm;
tm.setF (fv);// (0.1);
tm.setVectorField(fx,fy,fz); //(1, 0, 0);

pcl::TexMaterial tex_material;
                tex_material.tex_Ka.r = 0.2f;
                tex_material.tex_Ka.g = 0.2f;
                tex_material.tex_Ka.b = 0.2f;

                tex_material.tex_Kd.r = 0.8f;
                tex_material.tex_Kd.g = 0.8f;
                tex_material.tex_Kd.b = 0.8f;

                tex_material.tex_Ks.r = 1.0f;
                tex_material.tex_Ks.g = 1.0f;
                tex_material.tex_Ks.b = 1.0f;
                tex_material.tex_d = 1.0f;
                tex_material.tex_Ns = 0.0f;
                tex_material.tex_illum = 2;


                tm.setTextureMaterials(tex_material);
                std::vector<std::string> tex_files;
                tex_files.push_back("Texture.jpg");
                tm.setTextureFiles(tex_files);


                pcl::TextureMesh tex_mesh;
                tex_mesh.header = mesh.header;
                tex_mesh.cloud = mesh.cloud;

                std::vector<pcl::Vertices> polygon1;

                for (size_t i = 0; i < mesh.polygons.size(); ++i){
                        polygon1.push_back(mesh.polygons[i]);
                }
                tex_mesh.tex_polygons.push_back(polygon1);

                tm.mapTexture2Mesh(tex_mesh);

                viewer.addTextureMesh(tex_mesh, id, vp);


if i set the fv to 1 , the result is:



if i set the fv to 10 , the result is:



and set the fv to 1000, the result is:


I am very confused about the above results,
could anyone be able to explain the meaning of the setF and setVectorField functions?
thanks

Loading...