Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
Last active December 15, 2015 04:50
Show Gist options
  • Save taroyabuki/5204331 to your computer and use it in GitHub Desktop.
Save taroyabuki/5204331 to your computer and use it in GitHub Desktop.
マンデルブロ集合をOpenCLでインタラクティブに描く(Mathematica) http://blog.unfindable.net/archives/5772
buffer = OpenCLMemoryAllocate["Integer32", {height, width}];
Manipulate[Module[{
xMin = center[[1]] - 10^scale, xMax = center[[1]] + 10^scale,
yMin = center[[2]] - 10^scale, yMax = center[[2]] + 10^scale},
kernel[buffer, IntegerPart[10^maxSteps], width, height, xMin, xMax, yMin, yMax];
ArrayPlot[OpenCLMemoryGet[buffer],
DataRange -> {{xMin, xMax}, {yMin, yMax}},
DataReversed -> True, ColorFunction -> "Rainbow"]],
{{center, {-0.5, 0}}, Locator},
{{scale, 0, "Scale"}, -13, 1},
{{maxSteps, 2, "Log[maxSteps]"}, 1, 3}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment