I have a cube, with rotation quaternion.identity,
lets say the cube is sitting at position (2,0,2). I then have point A at position (2,0,-2), and point B at position (17,0,-2).
My goal is to determine to which degree a given face of the cube is visible from a point, 2 of these possible points are points A and B. From point A the front face of the cube is directly alligned with point A, so there should be a variable that indicates that the front face is dead center visible from point A, and no other faces are visible. On the other hand, from point B the situation is different, both the front face and the left face of the cube are visible, but to different degrees of visibility.
What is the best method to create this evaluation?
After this, how can I then account for the cube to have a different rotation than quaternion.indentity, and have the world rotation of the cube taken into account for the calculations?
My endgoal is to get the (relative angle of the cube)/(amount of each face visible) from a given vector 3 position.
Here is an image to try to express what im trying to detect:
here from point A, I expect that only the front face of the cube (red) to be fully visible, and be the only visible face, while from point b, both the front and left(blue) face of the cube should be visible, to different degrees of visibility.
Thanks in advance