CSS2DRenderer: Support Rotation#33474
Conversation
| * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right. | ||
| * The object's anchor point, and the point around which the object rotates. | ||
| * A value of `(0.5, 0.5)` corresponds to the midpoint of the object. A value | ||
| * of `(0, 0)` corresponds to the upper left corner of the object. |
There was a problem hiding this comment.
I did not change the implementation of the "center" API. (0, 0) was always the upper-left, not the lower-left, in this renderer.
The upper-left/lower-left convention is not consistent in three.js, and perhaps it would be advisable to agree to a convention going forward.
| * @type {number} | ||
| * @default 0 | ||
| */ | ||
| this.rotationAngle = 0; |
There was a problem hiding this comment.
We can't use rotation for the name. CSS3DRenderer uses rotation2D.
|
Temporary live example. Prior to merging, I intend to revert the changes made to https://raw.githack.com/westlangley/three.js/dev-css2Drenderer_rotation/examples/css2d_label.html /ping @Mugen87 |
|
/ping @johnperry-math @yomotsu |
|
I like the change. My only suggestion would be to add some words to the description of the CSS2DObject to the effect of
|
Fixes: #33455
In this PR, the existing
.centerproperty serves a dual purpose. It is both the center of rotation and the anchor point. I am not sure there is a need to decouple them.I think "anchor" or "pivot" would be better nomenclature -- for a future PR, perhaps.