News for hackers. Stuff that matters.
Re:Pure CSS new 3D effect by coderdude on Tuesday January 26, 2010 @07:52AM (#1077598)
The other examples on his blog are even cooler... check this out. http://www.romancortes.com/blog/css-3d-meninas/
Re:Pure CSS new 3D effect by ableal on Tuesday January 26, 2010 @12:41PM (#1078234)
And that one points to an explanation of the method, with diagrams and the partial pictures used:

http://www.romancortes.com/blog/3d-meninas-explained/

Re:Pure CSS new 3D effect by m0th87 on Tuesday January 26, 2010 @03:22PM (#1078723)
Strange, I had to refresh the page twice to get the effect to work correctly in Chrome. Each time it worked progressively better!
Re:Pure CSS new 3D effect by flog on Tuesday January 26, 2010 @08:02AM (#1077616)
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 be carefully calculated background x pos offsets? (I don't have firebug on this machine)

Re:Pure CSS new 3D effect by ajross on Tuesday January 26, 2010 @11:25AM (#1078014)
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 by morphir on Tuesday January 26, 2010 @11:17AM (#1077982)
I got js disabled. And the effect worked fine.
Re:Pure CSS new 3D effect by flog on Wednesday January 27, 2010 @04:27AM (#1080198)
Yep, cool - it just means a lot of empty div structures (n * width) to contain the samples... I assumed JS as it would have been more efficient.
Re:Pure CSS new 3D effect by middus on Tuesday January 26, 2010 @07:33AM (#1077557)
Awesome hack. I don't really have any application for this, though.
Re:Pure CSS new 3D effect by dagw on Tuesday January 26, 2010 @07:42AM (#1077578)
Well I can think of a use or two for the bird example, but I'm unsure why I'd want to use this method over something javascript based.
Re:Pure CSS new 3D effect by ams6110 on Tuesday January 26, 2010 @08:55PM (#1079543)
I think it could be used on any kind of catalog page to allow users to rotate the product image. Wonder what it would take to add a vertical scroll so you could rotate it in any direction. This kind of image manipulation is something I have no experience in.
Re:Pure CSS new 3D effect by amichail on Tuesday January 26, 2010 @01:14PM (#1078319)
Why are you interested in hacks? What's wrong with using better tech such as OpenGL?
Re:Pure CSS new 3D effect by eru on Tuesday January 26, 2010 @01:38PM (#1078383)
> Why are you interested in hacks?

Did you notice the name of this site? (And yes, for practical purposes OpenGL can be better.)

Re:Pure CSS new 3D effect by amichail on Tuesday January 26, 2010 @02:05PM (#1078459)
This site is more about startups than hacks.
Re:Pure CSS new 3D effect by eru on Tuesday January 26, 2010 @04:17PM (#1078890)
Perhaps. And the focus was even more sharp in the early days, when the name was still "startup news". Still, interesting hacks seems to have their place here.
Re:Pure CSS new 3D effect by citricsquid on Tuesday January 26, 2010 @10:56AM (#1077920)
Re:Pure CSS new 3D effect by robotron on Tuesday January 26, 2010 @07:39AM (#1077574)
This experiment is definitely worthy of a post. I haven't looked at how he did that or the "CSS Bird" shadow effect but I'm impressed that can be done without Javascript.
Re:Pure CSS new 3D effect by faramarz on Tuesday January 26, 2010 @03:14PM (#1078687)
Very cool. My question is.. how did he scan the coke-can? http://www.romancortes.com/ficheros/coke-label.jpg
Re:Pure CSS new 3D effect by javanix on Tuesday January 26, 2010 @05:22PM (#1079076)
I bet you could do it without "scanning it" per se.

Taking a set of pictures and then using stitching software, followed by some Photoshop touch-ups would probably give you a pretty good start.

Re:Pure CSS new 3D effect by ElbertF on Friday January 29, 2010 @01:37AM (#1085974)
Perhaps he cut it open.
Re:Pure CSS new 3D effect by nobosh on Tuesday January 26, 2010 @12:28PM (#1078197)
This is slick. I wonder how long it took to build that image/
Re:Pure CSS new 3D effect by polynomial on Tuesday January 26, 2010 @02:53PM (#1078611)
PROTIP: Try hiding the the width and the float on p and/or the padding and width on the 'div div' with firebug.
Re:Pure CSS new 3D effect by sscheper on Tuesday January 26, 2010 @12:20PM (#1078179)
That looks great. No trying to be a dick, but what's the point?
Re:Pure CSS new 3D effect by tvon on Tuesday January 26, 2010 @01:14PM (#1078318)
To demonstrate cool shit you can do with CSS.
Re:Pure CSS new 3D effect by dtegart on Tuesday January 26, 2010 @04:53PM (#1078998)
Well the first time you do it to see if you can, the second time because you can and the third time you use it to see if you can do something else
Re:Pure CSS new 3D effect by sandGorgon on Tuesday January 26, 2010 @01:12PM (#1078314)
wow!
Re:Pure CSS new 3D effect by levesque on Tuesday January 26, 2010 @09:57AM (#1077791)
Seems cpu intensive :) Server down.
Re:Pure CSS new 3D effect by tvon on Tuesday January 26, 2010 @01:12PM (#1078313)
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").

Re:Pure CSS new 3D effect by vinhboy on Tuesday January 26, 2010 @10:25AM (#1077842)
Wow amazing. Now I feel like a total CSS noob.