Code Monkey home page Code Monkey logo

Comments (5)

mlivesu avatar mlivesu commented on May 26, 2024

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

from cinolib.

yvanblanchard avatar yvanblanchard commented on May 26, 2024

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.

from cinolib.

mlivesu avatar mlivesu commented on May 26, 2024

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

from cinolib.

yvanblanchard avatar yvanblanchard commented on May 26, 2024

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 ?

from cinolib.

yvanblanchard avatar yvanblanchard commented on May 26, 2024

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.

from cinolib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.