Saturday, January 2, 2010

I think I should probably learn this...


https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html


WebGL. Apparently it integrates with the "canvas" element. I wonder if IE will properly support it.

I wonder if it matters anymore at this point whether IE supports it ;)

Seems to me, though, that the bulk of the applications I use either run or can run over the web, that its easier to get someone else to run your web app than your "compiled for XXX platform" app, and that Javascript/HTML/CSS is almost entirely unsuited for the type of applications I'd want to write. So, on that side, its probably about time for something like this.

On the other hand, I seem to recall VRML having Javascript support way back in the day, and am somewhat inclined to describe "manipulating scenegraphs with a functional language" as a more advanced form of programming than "mimicking C-style OpenGL calls in the same functional language" It is not as if one could easily implement an efficient scenegraph on top of a JavaScript OpenGL API. On the other hand, this sort of thing *might* be the appropriate way to "incorporate 3d style effects into a 2d Javascript UI"...

2 comments:

  1. I just looked at WebGL recently, but was given pause by how apparently no currently released browser supports it (but the next version of Firefox/Safari/Chrome will have it). Personally, I give IE the GFY. I still wish Java was the right answer, but seeing a Java AWT Applet look great on my Mac and crappy on a Linux desktop kinda turned me off to it for now. Native C is probably where I'm headed with my current home project of making a GUI hand-redistricting app.

    ReplyDelete
  2. Oh, yeah, there are a couple tricks to making java.awt apps look good everywhere.

    1) You have to do your own double-buffering. This is quite simple. You can grab an image the same size as the current Graphics2D object. Then you expose this image to your draw routines using Image.GetGraphics() which returns a java.awt.Graphics object. When your draw routines finish, you paste the results to the screen using java.awt.Graphics.drawImage(). If you draw directly to your applet draw context (or Graphics2d object) everything will flicker (or, worse yet, won't clear properly)

    2) You have to turn anti-aliasing on. java.awt.Graphics2d.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON) You do this at the top-level Graphics2d object. If you don't do this, everything looks like its out of the blocky 1980s CRT DOS Graphics era.

    ReplyDelete