Code for 2D camera system

This commit is contained in:
2025-03-08 12:26:20 -05:00
parent 7fb5a22cdf
commit 2d810fe20f
7 changed files with 291 additions and 5 deletions

View File

@ -27,6 +27,8 @@ If the chaos game encounters the same pixel twice, nothing changes.
To demonstrate how much work is wasted, we'll count each time the chaos game
visits a pixel while iterating. This gives us a kind of image "histogram":
import CodeBlock from "@theme/CodeBlock";
import chaosGameHistogramSource from "!!raw-loader!./chaosGameHistogram"
<CodeBlock language="typescript">{chaosGameHistogramSource}</CodeBlock>
@ -35,8 +37,6 @@ When the chaos game finishes, we find the pixel encountered most often.
Finally, we "paint" the image by setting each pixel's alpha (transparency) value
to the ratio of times visited divided by the maximum:
import CodeBlock from "@theme/CodeBlock";
import paintLinearSource from "!!raw-loader!./paintLinear"
<CodeBlock language="typescript">{paintLinearSource}</CodeBlock>