News for hackers. Stuff that matters.
Re:Show HN: Something pointless I made by dhotson on Sunday November 29, 2015 @06:16PM (#10646567)
I made this demo using http://www.pixijs.com/

Something I'm really happy with is the psuedo-3d effect on the cat using a displacement map.

I took the cat sprite (http://dn.ht/picklecat/mesmercat.png) and made a "depth map" (http://dn.ht/picklecat/mesmercatdisplacement.jpg) where white is closest and black is furthest. This information is used to determine how far to move the underlying pixels. It's enough to give a subtle illusion of depth.

Re:Show HN: Something pointless I made by rl3 on Sunday November 29, 2015 @09:11PM (#10647207)
I'd like to congratulate you for the fact that this has higher production values than the majority of WebGL applications out there.
Re:Show HN: Something pointless I made by _pmf_ on Monday November 30, 2015 @06:28AM (#10648867)
> I'd like to congratulate you for the fact that this has higher production values than the majority of WebGL applications out there.

1. Doesn't crash video card driver. 2. Doesn't crash browser. 3. Doesn't show empty tab. 4. Doesn't cause 100% CPU usage. 5. Doesn't hang browser forever.

Re:Show HN: Something pointless I made by vonklaus on Monday November 30, 2015 @12:06PM (#10650403)
I am on mobile with a 3 year old iphone 5.

Works.

Re:Show HN: Something pointless I made by prezjordan on Sunday November 29, 2015 @07:03PM (#10646774)
Would love to hear more about how you generated the depth map - that's super cool.
Re:Show HN: Something pointless I made by dhotson on Sunday November 29, 2015 @07:10PM (#10646800)
I'm glad you asked! :)

I created it in Adobe Illustrator using a gradient mesh: http://i.imgur.com/kuuFVO2.png

Illustrator's gradient mesh tool lets you create a grid of points where you can choose a colour for each point. I overlayed the grid onto the sprite and estimated the distance at each point.

Re:Show HN: Something pointless I made by ekianjo on Sunday November 29, 2015 @09:58PM (#10647374)
Is that something one can do with Inkscape as well ?
Re:Show HN: Something pointless I made by stuaxo on Monday November 30, 2015 @05:49AM (#10648771)
They have been building it, AFAICT looks like it's in the dev builds.

http://wiki.inkscape.org/wiki/index.php/Mesh_Gradients

Re:Show HN: Something pointless I made by voltagex_ on Sunday November 29, 2015 @10:48PM (#10647577)
Nope, wonder how much it would cost to get it implemented?
Re:Show HN: Something pointless I made by simoncion on Monday November 30, 2015 @03:53AM (#10648454)
Re:Show HN: Something pointless I made by voltagex_ on Monday November 30, 2015 @07:51AM (#10649101)
Evidently not! Nice find.
Re:Show HN: Something pointless I made by flashman on Sunday November 29, 2015 @07:20PM (#10646848)
That's a really clever solution!
Re:Show HN: Something pointless I made by zionpi on Monday November 30, 2015 @03:37AM (#10648407)
You mean each point?That's really tough work.
Re:Show HN: Something pointless I made by egypturnash on Monday November 30, 2015 @03:49AM (#10648445)
He didn't have to color in every single pixel. The gradient mesh lets you create a loose grid of Bezier curves, with a color set at each intersection; Illustrator will interpolate between them.
Re:Show HN: Something pointless I made by morganvachon on Sunday November 29, 2015 @10:10PM (#10647425)
Great work, silly but ingenious. For some reason I find the "depth map" creepy to look at on its own.
Re:Show HN: Something pointless I made by intjk on Monday November 30, 2015 @01:00AM (#10648015)
It looks like a ghost, or a 'soul'--that which brings life to an object. :)
Re:Show HN: Something pointless I made by x0 on Sunday November 29, 2015 @10:02PM (#10647398)
Well, I know what I'm doing for the rest of the day.

(if it wasn't obvious, playing around with pixijs!)

Re:Show HN: Something pointless I made by jevgeni on Monday November 30, 2015 @03:30AM (#10648391)
I'll spend my day looking at pickles, thank you very much.
Re:Show HN: Something pointless I made by namuol on Sunday November 29, 2015 @08:44PM (#10647130)
Yeah I came here to ask how you did the faux-3d cat. It's very subtle, but effective as hell. I thought you were using some kind of fancy parallax shader, but I can see how a displacement map can approximate the same thing. Awesome!
Re:Show HN: Something pointless I made by ricklamers on Monday November 30, 2015 @01:22AM (#10648091)
+1 for Pixi.js. Pixi.js is awesome.
Re:Show HN: Something pointless I made by sgrove on Sunday November 29, 2015 @07:04PM (#10646777)
I was wondering how you did that, actually - well done!
Re:Show HN: Something pointless I made by swcoders on Sunday November 29, 2015 @11:57PM (#10647809)
really great. Please write blog about this
Re:Show HN: Something pointless I made by cjslep on Sunday November 29, 2015 @06:58PM (#10646754)
How did you create the depth map?
Re:Show HN: Something pointless I made by mbilker on Sunday November 29, 2015 @07:25PM (#10646873)
He did it in Illustrator. I find his work fascinating.