Weekend

I implemented verlet integration in the cloth renderer friday, it was easy to do and produced a result much more stable than the euler method I started out with. I had problems using the spring system formula presented in Thomas Jacobsens article and implemented the formula discussed in Jeff Landers May 1999 Gamedevelopers Magazine column.

During the weekend, which I spend with my girlfriend in Aalborg, I started incorporating the virtual machine Lars, Martin and I wrote for our compiler course last semester, into my engine. The virtual machine is written in C and is fairly portable across your average selection of unix systems and variants (GNU/Linux), but it is monolithic and not compatible with Windows which is two of the problems I’m facing, they can be solved fairly easy though. Another problem is how to actually design the Scheme to C++ interface for the scripts to use. The lowest level of interaction will most likely be a single function added to the Scheme base which will be a gateway into the Engine kernel. I already added such a function and modified the compiler and VM to compile and use it properly. The function will act as a trap just like when making a system call to an ordinary kernel. How the rest of the functionality will go from there is still open. If you have any ideas, do not hesitate to contact me.

Reality Dysfunction

I just finished reading the Nights Dawn trilogy by Peter F. Hamlinton. It was really a remarkable book, and I had to buy the second book in the series because I could not wait for the library to get it from the guy who had it borrowed. If you are in need of some really high class science fiction I really recommend these books totalling in more than 3000 pages.

I have had some fun at work these past days where I have implementet a cloth renderer. I started out using a fairly simple spring system but I started implementing a more physically realistic model where the spring forces are calculated via Hooks law for springs and velocity and position is found using integratiCloth simulation with verlet integrationon. The result was fairly chaotic since I used Eulers integration method which is a highly inaccurate approximation of the real integral. Tomorrow I plan to move to verlet integration as explained in Thomas Jacobsens (of Hitman fame) article. The application is written using the OpenGL Performer graphics engine by SGI (which is used only for displaying the mesh) and the virtual reality framework vrJuggler, it is written to work with our GNU/Linux rendering cluster counting 4 machines (one machine for each of three projectors, and a controlling workstation). I am looking forward to see it in stereo in the Panorama.

Engine Scripting

I am thinking about how to incorporate a scripting language into my engine. Luckily aveng, gimpster and me implemented a compiler from a scheme-like language to a bytecode format interpreted by a lean VM written in C. I plan to make that VM the core of the scripting functionality, which would enable me to have a compiled scripting language. How to actually use it is the hardest part. I’m thinking about enabling the user of the scene graph to specify a script that will execute during the application stage of the rendering loop, that way animation scripts can be written in scheme and just inserted appropriate places in the scenegraph. For instance a script controlling the movement of a door can be writtens once in scheme and attached the scene-graph at leafs representing doors. Of course, one could write many different door scripts, all in scheme, and use them all as they see fit.

Another feature which could be cool and prove priceless for people scripting for the engine would be to enable the engine to track changes in the scripts and automatically reload them. That way you can code many interesting aspects of the scene graph – and debug them – without even restarting the main binary! All this comes at the price of running the scripts, which will be fast since the scripts are compiled into compact bytecode running on a VM complete with garbage collection.

Easter

I have had a relativly quiet time since the last update. My girlfriend spend the first part of easter here, and I went back to Northern Jutland this weekend to celebrate my dads birthday, only a week after he completed Paris Marathon 2004, way to go dad. On my side I have not been out running for three weeks while my knee heals (well, that is what I hope it does).

I spent a couple of hours implementing a 3DS loader for my engine. It was fairly easy since the fileformat is fairly simple. I still need to add support for materials and such, but the basics are working just fine.