This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15612 - rotate[XYZ]() should be defined in terms of rotate3d()
Summary: rotate[XYZ]() should be defined in terms of rotate3d()
Status: RESOLVED FIXED
Alias: None
Product: CSS
Classification: Unclassified
Component: Transforms (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 17:37 UTC by Aryeh Gregor
Modified: 2012-03-12 21:21 UTC (History)
6 users (show)

See Also:


Attachments

Description Aryeh Gregor 2012-01-18 17:37:17 UTC
"""
rotateX(<angle>)
specifies a clockwise rotation by the given angle about the X axis.
rotateY(<angle>)
specifies a clockwise rotation by the given angle about the Y axis.
rotateZ(<angle>)
specifies a clockwise rotation by the given angle about the Z axis.
"""
http://dev.w3.org/csswg/css3-3d-transforms/#transform-functions

"Clockwise" is not completely obvious -- which direction are you looking from?  It would be clearer if it said something like

"""
rotateX(<angle>)
specifies a clockwise rotation by the given angle about the X axis, same as rotate3d(1, 0, 0, angle).
rotateY(<angle>)
specifies a clockwise rotation by the given angle about the Y axis, same as rotate3d(0, 1, 0, angle).
rotateZ(<angle>)
specifies a clockwise rotation by the given angle about the Z axis, same as rotate3d(0, 0, 1, angle) or just rotate(angle).
"""
Comment 1 Dirk Schulze 2012-02-26 15:34:07 UTC
(In reply to comment #0)
> """
> rotateX(<angle>)
> specifies a clockwise rotation by the given angle about the X axis.
> rotateY(<angle>)
> specifies a clockwise rotation by the given angle about the Y axis.
> rotateZ(<angle>)
> specifies a clockwise rotation by the given angle about the Z axis.
> """
> http://dev.w3.org/csswg/css3-3d-transforms/#transform-functions
> 
> "Clockwise" is not completely obvious -- which direction are you looking from? 
> It would be clearer if it said something like
> 
> """
> rotateX(<angle>)
> specifies a clockwise rotation by the given angle about the X axis, same as
> rotate3d(1, 0, 0, angle).
> rotateY(<angle>)
> specifies a clockwise rotation by the given angle about the Y axis, same as
> rotate3d(0, 1, 0, angle).
> rotateZ(<angle>)
> specifies a clockwise rotation by the given angle about the Z axis, same as
> rotate3d(0, 0, 1, angle) or just rotate(angle).
> """
I don't understand why "clockwise around the XYZ axis" is not enough? Do you fear that authors take the axis from the wrong side?
Comment 2 Simon Fraser 2012-02-26 17:33:55 UTC
Is it clockwise when looking towards zero, towards negative infinity or what?
Comment 3 Dirk Schulze 2012-02-26 17:39:49 UTC
(In reply to comment #2)
> Is it clockwise when looking towards zero, towards negative infinity or what?
That is what I meant with "wrong side". Nevertheless, this issue is not solved on rotate3d, we would just delegate the problem to another place.

Maybe we can add "clockwise" by an axis to the terms section and define the view from looking from zero to negative infinite?
Comment 4 Aryeh Gregor 2012-03-01 17:14:30 UTC
There are two issues here: one is the clarity of the non-normative description, and one is the simplicity of the normative description.

The non-normative description ("a clockwise 3D rotation by the given angle about the X axis") isn't clear because it doesn't say which direction you're facing when evaluating what's "clockwise" -- I believe it's "toward negative infinity".

The normative description isn't as simple as it could be because it defines separate matrices for rotateX()/rotateY()/rotateZ() instead of just saying they're equivalent to rotate3d(1, 0, 0, ...) and so on.  It's simpler to implement and test if you can use the same code for rotate3d() as everything else.  At least it's simpler in my test implementation.

So I suggest "specifies a clockwise 3D rotation by the given angle about the X axis" be changed to something like "the same as rotate3d(1, 0, 0, <angle>): specifies a rotation around the X-axis by the given angle, clockwise as one looks toward the negative direction".  Or instead of "as one looks toward the negative direction", perhaps we could say "as one looks left", and "as one looks up" for rotateY(), and leave off the qualifier for rotateZ().

It should also be made clear that rotate() and rotateZ() are the same thing.
Comment 5 Aryeh Gregor 2012-03-12 21:21:54 UTC
I tried to fix this: http://dvcs.w3.org/hg/csswg/rev/24c3ba7855d9

Let me know if anyone doesn't like this change.  I'm not strongly committed to the wording, except that I think we should define all rotations in terms of rotate3d() to simplify tests and implementations.