Object rotation then why object position changes

changeRotation() {
if (this.activatedObject) {
if (this.degX == null) {
this.degX = this.prevDegX;
}
if (this.degY == null) {
this.degY = this.prevDegY;
}
if (this.degZ == null) {
this.degZ = this.prevDegZ;
}
this.degX = this.prevDegX = this.checkLimitBeforeApplyForInputSlider(Math.round(this.degX), 63, -63);
this.degY = this.prevDegY = this.checkLimitBeforeApplyForInputSlider(Math.round(this.degY), 63, -63);
this.degZ = this.prevDegZ = this.checkLimitBeforeApplyForInputSlider(Math.round(this.degZ), 63, -63);
if (_.isNumber(this.degX) && _.isNumber(this.degY) && _.isNumber(this.degZ)) this.activatedObject.rotation.set(this.degX / 10, this.degY / 10, this.degZ / 10);
this.renderCanvas();
}

}

It might be that the object’s origin is not in the center of the object.

2 Likes

How to do can you help me in this?

I’d suggest you read up on 2D transformations in computer graphics first. If you understand that, 3D is merely an extension of the same principles. Try this for starters.

Note, how the only point, which does not change its position during a rotation is at the center of rotation.

If it is because the model is not centered, this simple example may help you.

LoadGLTFmove

See also BeginnerExample step 3 (line 250 … 269 )

( from the Collection of examples from discourse.threejs.org )

Hello your beginnerExample is under construction Can you suggestion changes in my code

I have mentioned my code in this. Can you help find the which changes i should changes. because i can’t understand any in computer graphics theory