
Show HN: Programming with Escher - mapio
https://mapio.github.io/programming-with-escher/
======
jlebrech
reminds me of logo, or line drawing in basic

------
hatsuseno
The article references the Henderson Escher example, which is nicely surmised
in a SICP lecture from '86: SICP-3A video
[https://youtu.be/2QgZVYI3tDs?list=PL8FE88AA54363BC46&t=3678](https://youtu.be/2QgZVYI3tDs?list=PL8FE88AA54363BC46&t=3678)

I was instantly thrown back to my time watching this series and doing the
exercises, which I highly recommend to anyone.

------
Immortalin
This should be added to the Racket tutorial

------
brudgers
It might make sense to link to the repository with Jupiter notebook,
[https://github.com/mapio/programming-with-
escher](https://github.com/mapio/programming-with-escher) in the rendered
output for the convenience of the reader. If the repository points to the
rendered output, well Escher.

~~~
mapio
Actually it is, at the end of the first section
[https://mapio.github.io/programming-with-
escher/#Programming...](https://mapio.github.io/programming-with-
escher/#Programming-with-Escher) the sentence reads: "The source notebook is
available on GitHub (under GPL v3), feel free to use issues to point out
errors, or to fork it to suggest edits. Square Limit and tiles."

~~~
brudgers
Ah, thanks. I missed it.

------
virgil_disgr4ce
"Basic algebraic facts about transofmrations"

Heh, was that intentional? X-)

~~~
mapio
Ahahah, no… it's just that I'm terrible with typos. Thank you for reporting
it, now should be fixed [https://github.com/mapio/programming-with-
escher/commit/a102...](https://github.com/mapio/programming-with-
escher/commit/a1025645fab2dc78432403aeabca7c021047d7cc)

~~~
cauthon
Also this one, below the definition of `nonet()` :)

> to obtain the desider result

Awesome post!

~~~
mapio
Thanks, I'm flattered by all your positive comments!

Should be fixed now [https://github.com/mapio/programming-with-
escher/commit/1f04...](https://github.com/mapio/programming-with-
escher/commit/1f040963cfa684d3aa412ba778a366a03d25678e)

------
ttoinou
Ok for forward drawing, what about backward drawing ? i.e. finding the (u,v)
of the fish image from the (x,y) inside the infinite square ?

~~~
mapio
Beside the fact that the square fits the unit square and is not infinite at
all, I'm not sure to get what you mean…

~~~
ttoinou
If you draw a line from Point A to Point B, that's called Forward Drawing /
Mapping. Basically you will loop over every sample that you know (thanks to a
mathematical study) go near your line.

The reverse would be to look at every sample you have and decides its colors
based on the line information (the two points) with basic geometric calculus
(distance of a point to a line). Applying anti-aliasing / thicks borders is
more easy in this way also.

The reverse is called Backward Drawing / Mapping, and is fit for GPU
programming and others uses. Some problems are only defined for one kind of
drawing and it's difficult to transform it to the other kind. It's like
finding the inverse function of a mathematical function, hard.

~~~
mapio
Sounds interesting… can you provide any reference? A technical/scientific
paper, a book, a Wikipedia entry… I was unable to Google it using both
"Backward Drawing" and "Backward Mapping" as keywords.

~~~
ttoinou
I learned "Forward Mapping" in a scientific paper when I was creating my own
morphing and deformations algorithms, I don't remember which paper. (Some
Googled links I just found :
[http://biomachina.org/courses/imageproc/051.pdf](http://biomachina.org/courses/imageproc/051.pdf)
,
[https://www.cs.auckland.ac.nz/courses/compsci773s1c/lectures...](https://www.cs.auckland.ac.nz/courses/compsci773s1c/lectures/ImageProcessing-
html/topic2.htm) )

The term is mainly used for image interpolation and GPU textures. I prefer to
say "drawing" because the notion can be extended to anything you want to
visualise.

On the internet you can find a lot of visualization by forward drawing on a
canvas. But recently there's more and more backward drawing with GPU and
shaders (goto [https://www.shadertoy.com/](https://www.shadertoy.com/) for a
lot of examples)

