The rotation order matters. It's as simple as each rotation pushing a gimbal along by a linear distance of trigonometric functions of that angle in turns, in the rotation order... order.
Wikipedia has the matricial forms: http://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations What's not working from that? Or if you haven't looked at it, shame on you!