0

I am currently working on a project where I'm trying to control a rigged robotic arm model using sliders in React Three Fiber. The goal is to manipulate the arm's bones, specifically rotating them on the X-axis. However, I've encountered a problem where the bone's location changes unexpectedly and the rotation on the X-axis is not behaving as expected.

I have verified the model's behavior in Blender, where the same setup works perfectly. The issue seems to be confined to my React Three Fiber implementation. Here's what I've tried so far: ** Slider Controls**: I've implemented sliders to control the rotation of specific bones on the robotic arm. When adjusting the slider for the X-axis rotation, the bone's location shifts unexpectedly.

**Matrix Transformations**: I attempted to use matrix transformations to control the bone's rotation, but the results were inconsistent and didn't match the expected behavior.

**Comparing with Blender**: As mentioned, I've tested the same model and control setup in Blender, and everything works as intended. This suggests that the issue is likely related to my React Three Fiber code.

I suspect there might be an issue with how I'm handling the bone rotations or applying the transformations in React Three Fiber. Could this be related to differences in coordinate systems between React Three Fiber and Blender?

const process_s2angle = (s2_angle) => {
    const angle = map(s2_angle, 0, 180, -60, 60);
    if (nodes.b_s2) {
      const euler = new Euler(angle * Math.PI / 180, 0, 0, 'XYZ');
      const quaternion = new Quaternion().setFromEuler(euler);
      nodes.b_s2.quaternion.copy(quaternion);
    }
  }

rotation is not proper in reactThreefiber where as in blender: how it supposed to be rotated

I expected the bone rotation on the X-axis to behave similarly to how it works in Blender. When adjusting the slider or applying transformations, I anticipated the bone's rotation to change smoothly without unexpected shifts in its location.

codesmith
  • 1
  • 1

0 Answers0