Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSasha Drmic
12,316 PointsrotateY values
Can someone explain me why did we use those values for RotateY? For example:
I expected that the back side should be rotated for NEGATIVE 270degs, because the whole cube rotates clockwise (-270degs)
I expected the left side to rotated for -90degs
I'm very confused by these values.
2 Answers
Camilo Luna
8,836 PointsSince the .left
side is the second image you see, you need it to start "looking" to the right so when it is visibile, you see its front.
Since you are using negative values rotateY(-270deg)
the images are rotating to the left 3/4 of a turn. If you rotate -90deg (1/4 to the left) the image will start "looking" at the left and when it is visible (after rotating 1/4 to the left) you would have a flipped image since (-90deg) + (-90deg) = 180deg.
To check that this is happening indeed, exchange properties between .left
and .back
to see it with the text "side".
Cindy Lea
Courses Plus Student 6,497 PointsClockwise is turning to the left so the values go toward a positive direction.