Is it possible to rotate the Isolines on a Surface Using `MeshFunction`?

Since we have the identity

RotationMatrix[θ] == {AngleVector[-θ], AngleVector[π/2 - θ]}

one can use this to construct a mesh that is arbitrarily oriented; e.g.

Manipulate[Plot3D[Cos[x y/2], {x, 0, 4}, {y, 0, 8}, BoxRatios -> Automatic, 
                  MeshFunctions -> {AngleVector[-θ].{#, #2} &,
                                    AngleVector[π/2 - θ].{#, #2} &},
                  PlotStyle -> Directive[Lighting -> "Neutral",
                                         FaceForm[White, Specularity[0.2, 10]]]],
           {θ, 0, 2 π}]

Manipulate demo

Note that this rotates the mesh clockwise; use MeshFunctions -> {AngleVector[θ].{#, #2} &, AngleVector[π/2 + θ].{#, #2} &} instead if the anticlockwise version is desired.


You can use MeshFunctions -> (Function /@ (RotationMatrix[θ].{#, #2})) to rotate by angle θ:

θ = 75 Degree;
meshfunctions = Function /@ (RotationMatrix[θ].{#, #2});

Plot3D[Cos[x y/2], {x, 0, 4}, {y, 0, 8}, 
 MeshFunctions -> meshfunctions, Mesh -> {3, 8},
 BoxRatios -> {4, 8, 1}, Boxed -> False, Axes -> False, 
 ImageSize -> Large, 
 PlotStyle -> Directive[Lighting -> "Neutral", FaceForm[White, Specularity[0.2, 10]]]]

enter image description here

For 45 Degree rotation you can use the simpler MeshFunctions -> {# + #2 &, # - #2 &} to get

enter image description here