Sunday, March 14, 2010

Editing Tools in JavaScript

The video shows a 'slope tool' that makes it easy to create sloped surfaces in cube geometry. It isn't finished, but it shows what can be achieved by this approach, I think.

Basically, this is done using new JavaScript API bindings to editing code that works on the cube octree. Actually the editing code is fairly old - it was used already in a very early version of the Intensity Engine - but it was not enabled in the current JavaScript API until this week.

Using the expressive power of JavaScript, it is easy to create editing tools like this one, for all sorts of purposes. For example it can be used to import maze files to create maps with them, etc.

You need to run the latest compiled engine for this. The code is in library/1_3/Editing.js, and you can see it in action in kripken/editdemo, which you can run by entering that name into the server_runner plugin GUI, after logging in to the master (see README-standalone.txt). To see it work as in the video, do /actionkey0 when hovering on one corner, then the same command when hovering on the opposite corner (this is just for demo purposes, not how the final controls should be).

1 comment: