Rotation of a robot arm around a point

I have a gltf file that has a robot and I have to animate the robot arm but I am unable to get the pivot point to rotate an arm.
I am trying to follow the below steps:

  1. Move the object to the pivot point1.1. SUBTRACT the the pivot point from your object’s original position
  2. Apply your rotation
  3. Move the object BACK by the same position vector1.1. ADD the the pivot point to your object’s new position

This sounds roughly correct if you’re using matrix transforms. Can you share the code you’re using to do that?

hello ,
don’t know if objects come from blender , but at every object is associated an origin point . if you need arm does turn around a pivot point ,associate it in your software (blender ? ) the origin point of your arm at the pivot’s place . like this in your robot object and in init() method you can write

this.robot_arm = scene.getObjectByName(‘robot_arm’);

and after in your “run()” method of your robot object you can write

this.robot_arm.rotateY(this.robot_arm_rotation);

it will turn around your pivot point

edit: you can read that too ( Three.js Scene Graph ) , it could help you , it is about scenegraph and how to organize objects with group , to run complex movement /rotation with different object in your scene .

related