I wrote and optimized one use-case for it as well! "Create bouncing cube on canvas (with lighting etc.)"
Ended up with the special-case-rife DWIM snippet:
new Scene($('gl_canvas'), new Cube().makeBounce())
. Demos: lots of cubes and a simple bouncing cube.
4 comments:
The demo looks great! Unfortunately although it ran fine on my laptop last night, albeit slowly (it uses software rendering, not sure which version of Minefield), when I run it on the desktop today I get nothing displayed and the following error log:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsICanvasRenderingContextWebGL.uniform4fv]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://cs.helsinki.fi/u/ilmarihe/demo/gl-util.js :: anonymous :: line 206" data: no]
This is with the latest Minefield.
Cheers,
Giles
Oops, sorry about that. Fixed.
I was passing the array length to uniform4fv to make it work on Chrome. And Minefield doesn't ignore the extra arg :(
Cool, that fixed it!
(BTW at Coolcat's suggestion on the forums I've switched to using uniform4f instead of -4fv -- it makes the code a bit uglier but at least means that you can be Chrome- and Minefield-compatible with the same codebase.)
Post a Comment