I want to be able to rotate the entire object (Puzzle) based on the selected face (Front). Front is a child object with a normal that points outwards. I have faces for all sides (6) that point outwards. Given the selected face’s world normal, I want to be able to create a Quaternion to rotate the entire puzzle so that the select face is facing the camera.
Depending on how your getting your faces and setting the focus normal… you might be able to do this: Each face is linked with a side face. This side face has to be pointing along the positive X direction. So top links to right, back to left, right with the back, etc
have another object setup like focus, but called sideFocus. And set its normal to the linked face’s normal. Then i think this code should do the trick.:
To be clear when the program decides that the front face is the focus, it looks up in its table and sees that the right face should be the normal to set sideFocus too.