Sha256: 8e801def81031a94b797e4a7185d92d4710c8d642a3270c671509d0cc610d8d0
Contents?: true
Size: 638 Bytes
Versions: 6
Compression:
Stored size: 638 Bytes
Contents
# # Rotate 1. # # Rotating simultaneously in the X and Y axis. # Transformation functions such as rotate() are additive. # Successively calling rotate(1.0) and rotate(2.0) # is equivalent to calling rotate(3.0). # attr_reader :a, :rSize def setup size(640, 360, P3D) @a = 0 @rSize = width / 6 no_stroke() fill(204, 204) end def draw background(126) @a += 0.005 @a = 0.0 if (a > TAU) translate(width/2, height/2) rotate_x(a) rotate_y(a * 2.0) fill(255) rect(-rSize, -rSize, rSize*2, rSize*2) rotate_x(a * 1.001) rotate_y(a * 2.002) fill(0) rect(-rSize, -rSize, rSize*2, rSize*2) end
Version data entries
6 entries across 6 versions & 1 rubygems