Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I still think the calculations themselves are not relevant, it just seems like some experiment (especially with the screens from the video in mind). </p> <p>However, I'll try and explain what I think the code does (without more information it's not that easy):</p> <p>First, he loops over all screen pixels and calculates a color for those.</p> <ul> <li><code>double ydepth = y - height / 2;</code> would cause the depth to be negative for all pixels at the top half of the screen</li> <li><code>double xdepth = x - width / 2;</code> would cause the depth to be negative for the left half of the screen</li> </ul> <p>This seems to be done in order to center the generated pattern within the screen. There are those 2 black segments (lower left and upper right), but the code you posted doesn't explain what is done here.</p> <p><code>int xx = (int) (xdepth) &amp; 5;</code> would set the value of <code>xx</code> to 0 (i.e. black) whenever neither bits 1 nor 3 (5 is binary 101) are set. Thus <code>xx</code> can only have the values 0, 1, 4 and 5 which would cause those black streaks.</p> <p><code>xx * 128</code> would boost the value to 0, 128, 512 and 640, which would result in a different depending on how <code>pixels</code> is used. (If <code>pixels</code> represents colors in ARGB format, 0 would be black, 128 would be dark blue, 512 would be dark green (almost black) and 640 would also be dark blue with some slight green component.</p> <p>That being said, I just skimmed over the code and did some example calculations where necessary. For more information just follow that trail.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload