How to get the size and angle of rotation of an object

I have create a line as sphere 3D object. then to rotate the object based on user input, I have changed its angle by line_object.rotateZ(value);. Then I have to change the length of the line based on user input. For this, I am using line_object.scale.set(1,value,1); . I am changing the size and rotation of many objects like this. So now I have to know the exact size and rotation angle of each object for redrawing all those lines. How to do this?.
the value used in above code is received from the user slider.

Sorry, but I’m not sure I understand. Why don’t you just save the local transformation matrix after changing rotation and scale?

Thanks a lot for your reply @Mugen87. I am not sure what do you mean as local transformation.

I mean the Object3D.matrix property.

Oh. all parameters like angle and size will be exist in that. right?

Correct. In other words: Object3D.position, Object3D.rotation and Object3D.scale are “encoded” in this matrix.

Oh. Okay . Thank you so much Mugen

1 Like

Sorry @Mugen87. It is also not working. in that matrix, there are 16 elements are available. But the 16 elements doesn’t changing after I rotate the object also. Please let me know any other way to find it

You might have to call Object3D.updateMatrix(). Normally, this is done automatically by the engine when you call WebGLRenderer.render(). However, if you change the transformation and directly want to access the updated local matrix, you have to call the mentioned update method first.

So whenever I am changing the size and angle of rotation, the object3D.updateMatrix() also should be called. right?

Please have a look into this @Mugen87. this is the parameters of my Object

If you change Object3D.position, Object3D.rotation or Object3D.scale and you want an up-to-date local matrix, then you have to call Object3D.updateMatrix().

Yes @Mugen87. I am resizing the object by changing the scale and rotating it by changing the Object3D.rotateZ(value).Then I am updating the matrix also. Eventhough the matrix values are being same… :unamused:

@Mugen87 any update on this?

Sorry, but it’s best to demonstrate the issue with a live example. Unfortunately, I don’t have telepathic abilities so I don’t know what’s going wrong in your code.

can you please create a justfiddle for me to write a sample on that? @Mugen87

How about this one:

https://jsfiddle.net/f2Lommf5/

Sorry @Mugen87. actually it has already updating. But while consoling the entire object only it shows wrong values. when I logging the exact need in console. It shows the value. Thanks for your help.

1 Like

Yeah, obsolete console values can be sometimes quite confusing.

Yes @Mugen87. so only I was confusing.