Closed yvanblanchard closed 1 year ago
Hi, you could use offline rendering to render the two meshes into two buffers of equal size, using the same modelview/projection matrix. Once you have this, you just need to count the pixels that are hit in both buffers (hence by both shapes) and normalize by the total amount of pixels hit by one of the two shapes.
This whole thing is not implemented in cinolib, but it is actually very close to what I do for the computation of the Ambient Occlusion (https://github.com/mlivesu/cinolib/blob/master/include/cinolib/ambient_occlusion.cpp). In that case I am rendering a single mesh from multiple points of view (I am iterating over a vector of view directions). In your case you'd have a single view direction, but two meshes and two buffers. It should be fairly easy for you to adjust that code to do what you need
Thank you very much for your reply. Sorry for this other dummy question, but when trying to compile/link examples (such as 'ambient_occlusion' one), I get a linking error in MVS2017/Win10 (cinolib.lib not found). But I thought it was a header-only lib, with no output lib file ?
Thank you again.
Indeed cinolib is header only and is known to compile on MVS17 (see the associated workflow). Perhaps you are not doing something right. As a starter, try to use the CMakeLists.txt in the examples folder (the one that computes them all). It should succeed
Thank you. I used this time the cmakelists from the whole exercices folder this time, as recommended, and cmake was able to build a VS project with all the correct settings and then no more build not link errors. Strange that it was not the same using the cmakelists file from the (single) exercise folder..
last question about the exercise sample: I tried the exercise of tetmesh viewer, and I am not able to see the expected toolbar of settings in 3d window (slider for cutting plane, for seeing the internal meshing). Do I need to press a specific key to hide/show this settings control dialog ?
Sorry. I just noticed that the help for describing key functions was part of the console window. And it shows that TAB key controls the hide/show of the side bar.
Hello,
i would like to compute the covered area by a triangle mesh A on a second mesh B (made of either triangles or quads). Expected output is the covering ratio for each mesh B element.
I was wondering of your shadow casting (OpenGL) could be used for that need, and if yes how ?
thank you