Contact Info

(for those who care)

Instant Gratification   



Mon, 20 Dec 2004

Nifty: JavaScript + OpenGL == JiggleScript

JiggleScript is a development enviroment that combines the well-known web programming language JavaScript with OpenGL, the standard graphics API used in modern 3D games. The target audience are those that may be familar with JavaScript already from building web pages and would like to try their hand at something that might be a little more fun without needing to learn C or C++ or other “bigger” languages.

[source…]


<jiggle>
<script>
<![CDATA[

// Setup the window
window.width = 640;
window.height = 480;

// Setup the engine
engine.controlInterval = 70;

// Fun globals
var arrow = new Cylinder( 0, 1, 2 );
arrow.color = "yellow";

var shaft = new Cylinder( 0.2, 0.2, 4 );
shaft.attachTo( arrow );
// once attached to another object, the x/y/z become relative to the parent
shaft.z = -3;
shaft.color = "blue";

// The main loop
engine.onControlFrame = function()
{
    window.title = "approx. " + Math.round(engine.fps) + " fps";
    arrow.setPivot();

    // ...etc...
    // ...etc...
    // ...etc...
}

]]>
</script>
</jiggle>

Straightforward, no?

Way to go, Sean!

20:38 CST | category / entries / links
permanent link | comments?

Like what you just read? Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.



Thanks for Visiting!