Skip to content

Instantly share code, notes, and snippets.

@DideC
Forked from rebolek/logo.red
Last active February 23, 2018 17:03
Show Gist options
  • Save DideC/035f5faff08c42e015a105d5850a11b8 to your computer and use it in GitHub Desktop.
Save DideC/035f5faff08c42e015a105d5850a11b8 to your computer and use it in GitHub Desktop.
Live logo
Red[]
dst: [
pen 238.172.41
fill-pen 238.172.41 polygon 100x2 114x56 72x43
fill-pen 188.130.45 polygon 100x2 114x56 128x38
pen 212.28.24
fill-pen 212.28.24 polygon 118x72 132x128 36x96 64x54
fill-pen 129.31.34 polygon 118x72 132x128 169x88 135x48
pen 212.28.24
fill-pen 212.28.24 polygon 136x143 150x199 0x147 28x107
fill-pen 129.31.34 polygon 136x143 150x199 209x136 179x100
]
src: [
pen 238.172.41
fill-pen 238.172.41 polygon 100x2 86x56 72x38
fill-pen 188.130.45 polygon 100x2 86x56 128x43
pen 212.28.24
fill-pen 212.28.24 polygon 82x72 68x128 30x88 63x48
fill-pen 129.31.34 polygon 82x72 68x128 163x96 136x54
pen 212.28.24
fill-pen 212.28.24 polygon 64x143 50x199 -10x136 21x100
fill-pen 129.31.34 polygon 64x143 50x199 199x147 172x107
]
change-pair: func [
source
dest
coef
][
as-pair
dest/x - source/x * coef + source/x
dest/y - source/y * coef + source/y
]
morph: func [
source
dest
steps
step
/local coef out rule mark
][
coef: step / to float! steps
out: copy/deep source
parse out rule: [
some [
ahead block! into rule
| mark: pair! (mark/1: change-pair mark/1 pick dest index? mark coef)
| skip
]
]
out
]
view [
base 200x200 white rate 20
on-create [
face/extra: context [steps: 40 step: 0]
face/draw: probe src
]
on-time [
face/extra/step: face/extra/step + 1
if face/extra/step > face/extra/steps [
tmp: src
src: dst
dst: tmp
face/extra/step: 0
]
face/draw: morph src dst face/extra/steps face/extra/step
]
]
@DideC
Copy link
Author

DideC commented Feb 23, 2018

A little more 3dish, still not pixelperfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment