Peripheral drift illusion: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (Adjusting Media setting.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(3 intermediate revisions by one other user not shown)
Line 352:
public PeripheralDrift() {
setPreferredSize( new Dimension(460600, 460600) );
setBackground(LIGHT_OLIVE);
}
Line 370:
final int cellSize = outerSquare / 12;
final int boxSize = cellSize * 75 / 100;
final int margin = ( cellSize - boxSize ) / 2;
for ( int row = 0; row < 12; row++ ) {
int x = border + margin + row * cellSize;
for ( int col = 0; col < 12; col++ ) {
int y = border + margin + col * cellSize;
drawBox(x, y, boxSize, EDGES.get(col).get(row), aGraphics2D);
}
Line 432 ⟶ 433:
</syntaxhighlight>
{{ out }}
[[Media:PeripheralDriftJava.PNG]]
[[File:PeripheralDriftIllusionJava.png]]
 
=={{header|Julia}}==
Line 758 ⟶ 759:
This reproduces the codepen image and does indeed appear to move although it's static.
See the output [https://imgur.com/xyVcnif on imgur]
<syntaxhighlight lang="ecmascriptwren">import "dome" for Window
import "graphics" for Canvas, Color
 
9,476

edits