0

I'm trying to use object.rotation.x++;, but not to rotate from the object's center, rather a specific point - e.g the Origin 0,0,0. So if let's say an Object is at position(5,10,15), object.rotation would rotate AROUND the 0,0,0 point, rather than from within.

I tried using

object.pivot.x = 0;
object.pivot.y = 0;
object.pivot.z = 0;

And

object.transform(0,0,0);

And

object.translate(0,0,0);

With no avail

Objects are with the .gltf format

Vardan Betikyan
  • 354
  • 5
  • 20
  • Can you try calculating axes between center of object and origin and rotate object about this axes through `object.rotateOnAxis(axis,rad);` , just a though nothing tried and tested – aryanknp May 10 '21 at 06:21
  • So you have a visible `Object3D`, we'll call this the child. Create a parent `Object3D` at [0, 0, 0], add the child, translate (`.position`) the child by the radius of the orbit, rotate the parent. Changing the center of rotation is a matter of changing the `.position` of the parent. – Ouroborus May 10 '21 at 07:06
  • Mostly a duplicate of https://stackoverflow.com/questions/42812861/three-js-pivot-point – TheJim01 May 10 '21 at 13:23
  • Also note that `object.rotation.x++;` is likely to cause _extremely fast_ rotation, because [`Object3D.rotation`](https://threejs.org/docs/?q=object3d#api/en/core/Object3D.rotation) represents an [`Euler`](https://threejs.org/docs/?q=euler#api/en/math/Euler), with the values stored in radians (1 radian is roughly equivalent to 57°). – TheJim01 May 10 '21 at 13:28

0 Answers0