One of the challenges I am facing involves an application that loads a model.
Upon receiving a server response, I am provided with information regarding the axis to use for the right and up orientation. The format in which this information is sent can be viewed by clicking on the following link: server format
Given that three.js operates on a right-hand coordinate system, I am required to convert the server-defined orientation to align with this system.
For both upAxis and rightAxis, the server always returns possible values such as x_positive, x_negative, y_positive, y_negative, z_positive, and z_negative.
Converting from the left-hand coordinates provided by the server to the right-hand coordinates in three.js presents a challenge that I am currently addressing.
While I have created a starter code snippet, I am unsure about the next steps and additional tasks that may need to be accomplished:
function rotate() {
var a = state.currentInfo; //stores the values for upAxis and rightAxis
//EXAMPLE FOR X axis
if (a.upAxis === "x_positive") {
//object itself
scene.rotation.x = -90 * Math.PI/180;
}
}