REBOL [ Title: "EBUC CUBE" Author: "Gregory Pecheret" ] img: to-image make face [ edge: none size: 130x130 color: red effect: [draw [pen logo.gif circle 64x64 60]] ] angle: context [ x: 0 y: 0 z: 0 ] s: 130 cube: reduce [ reduce [s s negate s] reduce [s s s] reduce [s negate s negate s] reduce [s negate s s] reduce [negate s s negate s] reduce [negate s s s] reduce [negate s negate s negate s] reduce [negate s negate s s] ] blk: copy [] view/new center-face mainv: make face [ edge: none size: 600x600 rate: 0 feel: make feel [ engage: func [f a e][ angle/X: angle/X + 5 angle/Y: angle/Y + 8 angle/Z: angle/Z + 3 clear blk repeat N 8 [ point: pick cube N ZX: (point/1 * Cosine angle/Z) - (point/2 * Sine angle/Z) - point/1 ZY: (point/1 * Sine angle/Z) + (point/2 * Cosine angle/Z) - point/2 YX: ((point/1 + ZX) * Cosine angle/Y) - (point/3 * Sine angle/Y) - (point/1 + ZX) YZ: ((point/1 + ZX) * Sine angle/Y) + (point/3 * Cosine angle/Y) - point/3 XY: ((point/2 + ZY) * Cosine angle/X) - ((point/3 + YZ) * Sine angle/X) - (point/2 + ZY) append blk as-pair (point/1 + YX + ZX + 300) (point/2 + ZY + XY + 300) ] f/effect: compose/deep [draw [fill-pen 255.0.0.100 polygon (blk/6) (blk/2) (blk/4) (blk/8) image img (blk/6) (blk/5) (blk/1) (blk/2) fill-pen 255.159.215.100 polygon (blk/2) (blk/1) (blk/3) (blk/4) fill-pen 54.232.255.100 polygon (blk/1) (blk/5) (blk/7) (blk/3) fill-pen 0.0.255.100 polygon (blk/5) (blk/6) (blk/8) (blk/7) fill-pen 248.255.54.100 polygon (blk/8) (blk/4) (blk/3) (blk/7)]] show f ] ] ] do-events