I have created the 3D effect I am after using RotateX in this fiddle:
However, I am unsure how to achieve the same effect on the red square in this Fiddle:
http://jsfiddle.net/paulsidebottom/jbfSj/
What Matrix3D transform do I need to apply to the marker to get it to stand up in the vertical plane?
By inspecting the first example, then looking at the computed tab in Webkit’s inspector, you can see the matrix the first one used was:
Applying this as is doesn’t seem to work in your second example, but this maybe because of other differences in your code.
The reason this is used is because a rotation matrix in the X axis looks like:
In your case, a is 60 degrees, which in radians is π/3. cos(π/3) = 0.5, and sin(π/3) = sqrt(3)/2 = 0.866025.