[HN Gopher] ASCII 3D Renderer for JavaScript
___________________________________________________________________
ASCII 3D Renderer for JavaScript
Author : thunderbong
Score : 85 points
Date : 2024-08-10 09:31 UTC (2 days ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| owenpalmer wrote:
| Reminds me of https://asciicker.com/.
| lsc4719 wrote:
| Amazing!
| smusamashah wrote:
| This immediately reminded me of this ascii graphics library
| https://play.ertdfgcvb.xyz/ which I found on HN a while ago
| sukmaagung wrote:
| So, as long it uses only text, it can be called ASCII art, not
| just characters from space to tilde (or null to tilde)?
| mock-possum wrote:
| Colloquially, yes.
| mxfh wrote:
| Its just 3 bits white plus those 7 box art chars.
|
| private Shade = '*++'; [1]
|
| Would have expected something more sophisticated, where the
| shader also looks at subpixels, where it gets the best matching
| char for the shape and brightness.
|
| Like rastapasta map renderer did with the braille block:
|
| https://github.com/rastapasta/mapscii
|
| https://news.ycombinator.com/item?id=39975887
|
| ---
|
| https://github.com/kciter/ascii-3d-renderer.js/blob/1f1a8493...
| [1]
|
| Shades and Box art chars where never part of any ASCII
| standard. https://en.wikipedia.org/wiki/Code_page_437
|
| Technically no ASCII but that's just for purists
| https://en.wikipedia.org/wiki/ASCII_art#%22Block_ASCII%22_/_...
| Retr0id wrote:
| Yes, sadly this semantic battle has already been lost.
| nox101 wrote:
| I'm pretty sure it's rendering strings but there's also the
| technique of post processing on the GPU like this
|
| https://threejs.org/examples/?q=asc#webgl_effects_ascii
| LukaD wrote:
| This video goes into depth about ASCII rendering as a post
| processing effect: https://www.youtube.com/watch?v=gg40RWiaHRY
| EGreg wrote:
| "goes into depth"
|
| I see what you did there
|
| (without intending to do it)
| thih9 wrote:
| IMHO in this video the end result doesn't qualify as ASCII
| art - square letters in particular are a deal breaker to me.
|
| It is still a cool shader that turns input into text, even if
| it doesn't have the ascii art vibe.
| california-og wrote:
| ASCII just refers to the 7bit standard, so if we are
| pedantic ASCII art is just art using the printable
| characters of the 128 code points defined in it. Font size
| doesn't have anything to do with it. But ASCII art is used
| as an umbrella term, encompassing a variety of different
| standards, character sets and fonts. There are a bunch of
| square ASCII, like PETSCII, ATASCII and even PC ASCII can
| be rendered with a 8x8 cp437 font. We don't need to
| gatekeep what "qualifies" as ASCII art.
| thih9 wrote:
| > There are a bunch of square ASCII, like PETSCII
|
| Note that e.g. PETSCII, while internally 8x8, would be
| displayed using non-square pixels[1] - also not resulting
| in square letters.
|
| [1]: https://retrocomputing.stackexchange.com/a/13871
| gewaltig wrote:
| My younger self cries out in joy. So 1980s when you could print
| an ASCII picture of yourself on mugs and Ts
| _the_inflator wrote:
| BBS vibes as well.
|
| I did quite a lot of printing on dot matrix printers as well.
| agys wrote:
| Self plug: the "ASCII Playground" has a couple of 3D demos as
| well!
|
| DOM manipulation is fast enough to allow text output into a PRE
| element as long as text color is not changed too often (each
| style change needs the affected chars wrapped into a SPAN).
|
| https://play.ertdfgcvb.xyz
| Xen9 wrote:
| Anyone who attempts to generate 3-dimensional renders by
| textual means is living in a state of sin(x).
| rrnechmech wrote:
| If this is sin, give me chastity and continence, but not yet
| :)
| agys wrote:
| Cos(x) players are welcome!
| slowmovintarget wrote:
| Are we not all sinusoidal in the eyes of the Function?
| MaanuAir wrote:
| Immediately reminds me of: https://aa-
| project.sourceforge.net/index.html
| woodrowbarlow wrote:
| see also: donut.c which renders a 3d spinning torus in ascii.
| https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html
|
| explanation with animations:
| https://www.a1k0n.net/2011/07/20/donut-math.html
___________________________________________________________________
(page generated 2024-08-12 23:01 UTC)