News for hackers. Stuff that matters.
Re:CSS 3D Lighting Engine by chao- on Monday June 18, 2012 @12:37PM (#4127239)
As an upfront disclaimer, I want to state that I think this is incredibly neat, and that I'm just trying to resolve a nagging question in my head.

Every time I see very well-done CSS animations, and especially when I see it extended into the realm of 3D graphics, I immediately think: To do all of this [animation/3D], the creator had to know a good bit about [animation/3D]. What makes them look at CSS and say "Yes! THIS is the language I want to do serious 3D work in!"?

Put less sarcastically: I find CSS to be a pain more often than not. What advantages do these Webkit-only CSS tricks have over WebGL? I was given the impression that the latter is more fully-featured.

Re:CSS 3D Lighting Engine by thomasxiii on Monday June 18, 2012 @01:22PM (#4127472)
I totally agree with you. Implementing this with WebGL would be much, much easier. However, I believe there is a need for lighting effects for simple interfaces built with HTML and CSS. The library is more for intermediate developers who want to add a touch of lighting without heavy programming.

Modeling 3D objects – like the Photon crane – with CSS is absurd! It was done solely for that initial "neato!" effect.

Hope that helps clear some things up.

Re:CSS 3D Lighting Engine by chao- on Monday June 18, 2012 @01:28PM (#4127507)
Clears it up perfectly :)
Re:CSS 3D Lighting Engine by tambourine_man on Monday June 18, 2012 @05:56PM (#4128817)
I think it's same reason why people develop a JavaScript game of Tron in 219 bytes. Because you can, because it's a challenge and fun.

I don't really know why, but I also find great joy in working in constrained environments, and usually end up learning something in the process.

Re:CSS 3D Lighting Engine by darklajid on Monday June 18, 2012 @11:29AM (#4126862)

  Requirements

  Photon relies on the WebKitCSSMatrix object, so WebKit 
  is the only browser engine currently supported.
No idea what it's doing. I was clicking around for some time before I went to the 'Documentation' link, so maybe I can save others with the same issue (no Chrome) some time.
Re:CSS 3D Lighting Engine by vecinu on Monday June 18, 2012 @11:48AM (#4126963)
Thank you. I was clicking everywhere trying to see why I wasn't seeing any 'lighting'.

The author should put a Chrome-only warning on the front page.

Re:CSS 3D Lighting Engine by TazeTSchnitzel on Monday June 18, 2012 @11:57AM (#4127024)
Ah. I somehow missed the "CSS" in the title and thought it was WebGL, was surprised when it didn't work in FF.
Re:CSS 3D Lighting Engine by vhf on Monday June 18, 2012 @12:07PM (#4127080)

  No idea what it's doing.
It does exactly what the title says. ;)

Quite impressive work.

Re:CSS 3D Lighting Engine by splatcollision on Monday June 18, 2012 @12:00PM (#4127038)
Very neat work!

You could make it cross-platform (not webkit-only) by using a JS implementation of the WebKitCSSMatrix object, which happens to be available as part of the Firmin JS Animation library. It's a technique I use in Edit Room (link in profile) to support javascript controls for modifying 3D CSS transforms.

Here's the relevant file: https://github.com/beastaugh/firmin/blob/master/src/matrix.j...

You could use this when WebKitCSSMatrix doesn't exist, and support other browsers that support 3d transforms:

Something like:

//shim to create CSSMatrix object reference using either WebKit or Firmin implementation

if (!window.CSSMatrix) window.CSSMatrix = window.WebKitCSSMatrix || window.FirminCSSMatrix;

Re:CSS 3D Lighting Engine by thomasxiii on Monday June 18, 2012 @01:18PM (#4127450)
I'm going to be looking into this. I hate putting "WebKit only" on things, but this was the simplest solution I could find. Thank you for this!
Re:CSS 3D Lighting Engine by NathanKP on Monday June 18, 2012 @03:11PM (#4127979)
I noticed in Google Chrome that the edges of the crane figurine did not quite meet up, so that there were black lines in the body of the crane where the separate planes didn't quite meet.

I've noticed in the past that CSS seems to have real problems with this in other cases as well.

Re:CSS 3D Lighting Engine by jjcm on Monday June 18, 2012 @05:58PM (#4128828)
It's not constrained to CSS. Corners have always been a troublesome issue with 3D environments, and there are quite a few hacks needed to get it right. In many older games you used to be able to shoot "through" corners, as edge detection becomes difficult there. Minecraft still has issues with edges, and seeing what lies behind them is pretty common.
Re:CSS 3D Lighting Engine by nu11pointer on Monday June 18, 2012 @12:19PM (#4127143)
Does this only work on Chrome for OSX or something? I use Chrome on Windows exclusively and I just see a blank page.
Re:CSS 3D Lighting Engine by RandallBrown on Monday June 18, 2012 @12:28PM (#4127191)
works fine on windows chrome for me. V19 on the regular release channel.