Any idea how to achieve this?

Hi, I have a situation to draw something like this. I have data from the coordinate system shown in above picture(right). I have a cube placed in between Pa and Pb. I know the coordinates of Porigin, Pa, Pb respectively. I can also calculate the position of camera which is always at a constant distance from Pb. I want to see the side of the cube where the “text” is written.

My approach was:

  1. I swapped the Y,Z axis of the given coordinate system.
  2. Considered Porigin as a coordinate in 3Js world space
  3. Calculate Pa, Pb in 3JS world space from Porigin
  4. Then calculate Pcamera from Pb
  5. Add Pa, Pb, Pcam in the scene

Issue I am facing:

  1. It looks like I am seeing “text” side of the cube from an angle, means i can see other side of the cube partially. Which shouldn’t be. I should only see the side of the cube where “text” is written.
  2. Cant identify what could be the issue here, issue in my implementation or issue in data.
  3. Any idea would be helpful, or any other approach would be helpful.
  4. Any debugging method would be helpful. So that I can check the given to the current position of Pa, Pb and Pcam, and orientation of the cube, I am seeing the right side.