# Changing function along the z-axis in a 3D plot

I'm trying to figure out how to change the period over time (z-direction) in my 3D plot, which is a gyroid, in a way similar to a color thickness function, but I would like to do it continuosly on the function.

ContourPlot3D[
Cos[x] Sin[y] + Cos[y] Sin[z] + Cos[z] Sin[x],
{x, -0, 16}, {y, -0, 16}, {z, -0, 16},
Contours -> {0},
PlotPoints -> 6,
ViewPoint -> {1, 1, 1}]


The above is the code I use. I would like to add a function so I can change the gyroid repetition frequence over time.

Hope you can help me!

• Consider what happens when you replace $z$ with $c z$, $c > 0$... – J. M.'s torpor Feb 25 '16 at 9:42

If I understand correctly, you wish to make the frequency increase with increasing z. Try something like this,

With[{ω = (1 + .2 z)},
ContourPlot3D[
Cos[ω x] Sin[ω y] + Cos[ω y] Sin[ω z] +
Cos[ω z] Sin[ω x], {x, -0, 16}, {y, -0, 16}, {z, -0,
16}, Contours -> {0}, PlotPoints -> 6, ViewPoint -> {1, 1, 1}]]


Or, using a smaller initial frequency,

With[{ω = (.1 + .2 z)},
ContourPlot3D[
Cos[ω x] Sin[ω y] + Cos[ω y] Sin[ω z] +
Cos[ω z] Sin[ω x], {x, -0, 16}, {y, -0, 16}, {z, -0,
16}, Contours -> {0}, PlotPoints -> 6, ViewPoint -> {1, 1, 1}]]


• thank you very much ! I´m new to mathematica so i dont now the functions and stuff that good yet. i´m trying to transfer my matlab knowledge to mathematica but it takes time :) – pblomstrom Feb 25 '16 at 10:57
• @pblomstrom, I wasn't clear if this was what you were looking for when I read your question. Did this cover it? If not, we can try to nail down the problem, if it did answer, you can mark the question as answered, as shown in the tour – Jason B. Mar 2 '16 at 12:59
• it did , thank you ! – pblomstrom Mar 2 '16 at 13:01