I'm amazed by today's 3D webcomics found at xkcd. How would he have done that? Would it require manually redoing every single comic or is there some way to automate it?
The 3D comics are still available on http://xk3d.xkcd.com
According to the xkcd FAQ, the name "xkcd" doesn't stand for anything. In his Google-speech, Randall said that xkcd originated as a previously unused random 4 letter string which he used, e.g., as his account name on various internet services.
When xkcd creator Randall Munroe first posted a new installment of his webcomic titled "Time" on March 25, it looked deceptively simple: a picture of two black and white stick figures, a man and a woman, sitting wordlessly on the ground.
Explanation[edit] On January 10th 2022, Randall added a countdown in the top right corner of the xkcd Header text on xkcd . It turned out that it was a countdown to the reveal of Randall's new book what if? 2 which was announced at the end of the countdown.
Each image is split into layers - each layer is its own PNG file and includes a lot of transparency.
All these images are nested inside a <div>
:
<div id="comic">
<!-- style attributes omitted -->
<img src="http://imgs.xkcd.com/xk3d/880/headache_box.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_handle.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_bike.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_handle.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_girl.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_desk.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_mask.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_computer.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_desk_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_guy.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_computer.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_corners.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_desk.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_box.png" >
<img src="http://imgs.xkcd.com/xk3d/880/headache_text.png" >
</div>
... the <div id="comic">
is relatively positioned (or more importantly, non-statically positioned) and each image is absolutely positioned within it, as well as re-sized. As you move the mouse, some intense number crunching is done to recalculate new values for the top
and left
CSS properties of each image.
I wrote some more about it on my web site, and explain how to build your own simplified version from the ground up: http://richard.jp.leguen.ca/not-blog/how-is-xkcd-in-3d
The splitting of each image into layers, however, is automated, with a (April fools joke?) call for volunteers to make it better.
It's (semi) manual, and Randall is trying to crowdsource the conversion, see here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With