Transclude of HCR-~-Exam-2022-01-26#^exercise-3


  • Given a triangular mesh of an object, we need first to identify the bounding box, so the smallest box that contains the triangle we want to ‘study’:
    So we start by checking it the end-effector represented by an avatar vector is inside or outside the “starting box”, if it is outside, then we are certain that there is no contact, otherwise if is inside the bounding box, we consider a more restrictive (a smaller) box, and check again, we continue to shrink and check this way untill we find that: is not inside the current bounding box, so the end effector does not touch the object, or we have reached the minum bounding box.
    Also we can calculate the minum distance between and (a point of the triangle/plane):
    1. We start by defining the plane we are working with, with its coefficients:
    and , such that:2. Then we find such that the distance between and is minimum so:3. Then using the distance , we can say that if then the end-effector does not touch the plane, the end-effector is “inside”/is touching the object.
    4. We can use the value of the distance as a way to give a proper response to the user, like changin the output force of the manipualtor if we have an higher value .