Now macs have all gots webcams, and seeing the current trend towards really shiny GUI buttons, why dooesn't Aqua now have buttons that really reflect what is going on in the room?

Right, I had a good go at lush and after too many errors I'm giving up. Not enough documentation - the Ogre toolkit looked awsome but without any documentation I thought I'd rather be back in Java. There were too many random crashes for my liking but Stack overflows are to be expected tho!:

? (fib 6000)

*** printf : sorry, stack full (Merci Yann)

My next effort is to get the jacol libary built under os x.... The plan here is to use the (if not) excellent (then slow) swing and jMonkey libaries from inside clisp. From what I can tell it (like lush) has been abandoned, but since I know a little Java I figured it was worth a go.

First up this error shows up after ./configure --prefix=/sw/bin (cause I'm a fink user) and doing make

;; Compiling file /Users/tomkelly/Desktop/jacol-0.33/lib/md2.lisp ...
*** - invalid byte #xE9 in CHARSET:ASCII conversion

Tis a character encoding thingy (guess the old version of clisp wasn't utf8 friendly). A little searching showed and answer in an old log page. So it seems to build if you change the 'pre:' section in the Makefile to (alternative fix)
clisp -q -c build.lisp
clisp -Efile ISO-8859-1 -Eterminal ISO-8859-1 -Emisc ISO-8859-1 -q -c ./lib/md5.lisp;
cp ./lib/md5.fas ./src/lisp;



next up I didnt want to install this fly by night (read: no native os x) thing onto my system (and beside make install didn't really work). I changed the jacol-0.33/bin/jacol script by replacing the relevant line with:
then I could start the server-
/jacol-0.33/bin$ jacol -jp 2424 -s
Java server listening on port 2424
Lisp server listening on port 16763
To get me a java server running on port 2424. A basic test says it works - woo!
~/Desktop/jacol-0.33/examples/dates $ ../../bin/jacol date-formatter.lisp
18:46:03 2006
September 2006 AD
The time is 06 46 04
Your time zone is BST
Your time zone is also British Summer Time

But I did end changing the /bin/jacol script file to point to the absolute location of JACOL_HOME. Guess I'm just a linux l4m3r...swing demo works too -

(I always have to get one picture into a post....) Right, so now what do I have to do to be able to call java fns from inside the clisp interactive environment thingy?

Then I decided that I've got way to much free time at the moment for it to be this easy, so I'm trying to write my own socket based RMI for lisp. The trick is with these things to make sure that someone else you can talk to has finished the same thing, or that there are lots of people doing the same thing around you doing the same thing.I have neither - most of the lisp/java crossovers are abandoned....


"The Starcraft AI isn't very I"
"...but it's kinda A"

Here's a thought, if you have a very small circular polygon, and grow the edges outwards (camp skeleton stylee) then it is just an approximation of a Voronoi:

If a and b are polygons and we give each edge a negative weight then where they intersect we get a voronoi tesselation of sorts. By giving the sides different negative speed we immitate a voronoi where each point has a shape that grows out of it. (We could even change the shape as it grows outwards, but thats getting ahead of ourselves)

Now of course this is pointless (as the voronoi has a lower time complexity) for circles. However if we wanted to create an interesting brick wall, instead of circles we could use brick shapes... suddenly we are in the situation where we can grow interesting bricks to fit the shape of the walls. So different shaped bricks can be mixed and matched with suitable input polygon generators.

(from a punt in cambridge, just downstream of the mathematical bridge, or rob's version)
(tower of london from the river side)
There is still a problem when we then get to texturing corners. As explained by Legakis, 2D texturing dont work right on the corners of buildings:

His approach was to cut the building up into a bunch of lego (more like duplo) blocks (funny that he ended up needing a straight skleton implementation to shrink the mortar between the bricks in correctly) . Each block was then textured according to its meta data and situation eg 'next to a window and on the side = this type of block'. This doesn't give much scope for interaction between the bricks, but it does look like a really fast algorithm!

There's some serious potential for improvement here - we push the camp skeleton into 3D and then give it an input volume (bounded by the outer wall and a shrunk wall thickness). Then we create brick shaped (tiny) input polygons in the centre of the bricks and let them grow outwards into one another to fill all the spaces. We get a nicely tesselated brick wall out of it! We'd need to remember to set different speeds on different sides to keep a proportioned brick shape -

(grey are input polygons with various negative weights, other bold lines are camp skeleton output-should extrapolate to 3D too....)
This is too much detail for today's graphcis cards, but from this we could render the bump/displacement maps to make walls look really good. There would be some work in defining where the centre of bricks would go, and possibly the need to tweak Felkel's skeleton implementation to give priority to one brick after an intersection (to keep them square) but it should all work kinda nicely in the end....

I guess we would let the brick volumes intersect, then shrink them back in again to create the morar. The outside surfaces could have a roof-like straight skeleton applied to them to make them bevelled.

Well thats enough work for a pHD, but I've been thinking about this and I think Bristol has left a giant gap in my education - working with other people (who arn't nerds). Think its time I got a job behind a bar.

Random thoughts:
  • If a straight skeleton is created, then we can take another line pattern, say a 'curve' and exturude it along the edges of the skeleton? It wouldn't change the intersection points and would need to be scaled for the different weights, but it may be a faster way to make more complicated rooves:
  • People keep comming to this page for a straight skeleton implemetation (often in java). I think I'd better write one that I dont mind publishing. Think I'll get all the ideas correct in lush first and then throw it into java. I tried seperating out my code from sity the other night, but was far too tightly coupled to get it out gracefully (and its crap).


Now onwards! just having a go at getting lush to compile on my mac/os x 10.4. Why? well I'm a convert of paul graham's and want to learn lisp, but I'm also into graphics so lush seems about right. I'm a little concerned that it doesn't get updates more than once a year, but may well be a fun toy.

Finally got it built by following the readme and the obvious google links. Once it I was trying to run the demos I kept getting errors like this

*** error : cannot configure OpenGL
libglut.so could not be found.
please make sure GLUT or libMesaglut3 is installed.
Both the library and the development packages are needed.
(see /Users/tomkelly/Desktop/lush-1.2/packages/opengl/opengl-config.lsh for more details)

turned out I also needed to fink install glut, sdl-image & sdl to get the correct .so libraries to run the demo. I just installed it locally to try it out, then ran the lush1.2/demos/RUNME script and it gave me a neat (if slow) menu. I was kinda supprised how little code made the menu (compared to say - java & swing).

Really neat stuff - I gotta learn lisp and learn it good. I've got two things I want to work on nowish -
  • Terrain generation. I've just started reading papers, such as those about the ROAM algorithm - seems really compact algorithm for regular terrain meshes. I kinda invented it in my head the night before, realised how obvious the idea was and then found it online. Realtime mesh decimation (with things like animated deforms or 3D objects) seems like a fun thing to do. Annoyingly the US is way out front in this with the Lawrence Livermore Labs turning out some great papers. First thing is to look through the options - the types of decimation (removing a point, edge or triangle) in combination with organisational schemes (bintrees, octrees, triangle trees or BSP), ideally being able to plug each into each other to get some quick readings would be neat - perhaps lush will help me out on this. It'd be cool to come up with a non-regular mesh decimation technique that allowed for real-time deformations and animations...
  • A rigerous camp skeleton implementation would be fantastic and would be a really good start for a rewrite sity. General plan would be to work out the details, implement it and get it right in lisp then take back into java.
Come to that I find that graham is really into the web based apps, makes me feel a bit out in the cold...all the stuff thats really heating up at the moment is the web sheneagoats. Perhaps I need to get into the games market more - nah working in games would be too much like hard work after all those rumours of how hard they push people at EA.

Blogger rant - would it be that hard for the bloggy people to make uploaded images appear the cursor position? ;) Still I really like the beta version!