Live data from Hacker News

Pure CSS new 3D effect

romancortes.com

11–20 of 31 posts

Re: Pure CSS new 3D effect

#11
post #6

Nice effect. I think a bit of JS is being used to create the DIV structure, but that's not important. It could also be improved a bit: you could remove the shading gradient from the Coke can mask PNG, and render the shading using an CSS gradient with RGBA values. That would mimic the specular highlighting, and you could also animate the shading. I still haven't quite grok'd the displacement method though... it must b…

I got js disabled. And the effect worked fine.

Re: Pure CSS new 3D effect

#13
post #6

Nice effect. I think a bit of JS is being used to create the DIV structure, but that's not important. It could also be improved a bit: you could remove the shading gradient from the Coke can mask PNG, and render the shading using an CSS gradient with RGBA values. That would mimic the specular highlighting, and you could also animate the shading. I still haven't quite grok'd the displacement method though... it must b…

No scripting. Here's a direct link to the effect page:

http://www.romancortes.com/ficheros/css-coke.html

Looks like it's just slicing up a wraparound texture vertically -- no scaling, just subsampling. The can and highlight are just composited on top. Slick and clever.

Note that it's really not "3D" in a meaningful sense. It's doing pixel-aligned warping only, and is hard-coded to a cylinder (any "lathe" shape would also work). This is the same trick that the Amiga used for the bouncing ball in 1985.

Re: Pure CSS new 3D effect

#17
post #7

Seems cpu intensive :) Server down.

Were it CPU intensive it would be so on the client side and have no affect on the server, and fwiw, scrolling back and forth quickly I saw no cpu spike (fairly new MBP, granted).

It's more likely that the site has been taken down by being posted on sites like HN/reddit/digg/etc (it was easier when we could just say it was "the /. effect").

Post reply on HN