21st Century Smalltalk

February 19, 2007

Physics Libraries

Filed under: General — pfisk @ 8:57 pm

In order to create realistic animations, some consideration has to be given to physical constraints in the real world. For example, objects don’t accelerate or decelerate instantaneously and bouncing balls lose energy with each bounce.

Fortunately, there are numerous sites (mostly Flash) where the mathematics of creating believable animated effects are explained in detail. I will try to integrate some of these techniques or libraries when I start doing animations over the next few days.

The expressive power of Lisp/Smalltalk with P2P networking and some good graphics could be the basis for some really creative games.

Comparing Flash and WPF

Filed under: General — pfisk @ 8:37 pm

Now that I have been programming in the ActionScript/Flash environment for a few weeks, I thought it might be useful to compare it to the C#/WPF environment.

These are just some impressions, in no particular order:

  • Adobe’s documentation is much better than Microsoft’s – better organized and visually more appealing
  • Microsoft has better tools – in particular, I like using Visual Studio better than Eclipse
  • it is surprising how similar the two frameworks are – MXML and XAML, both use “code-behind”, both C# and ActionScript seem to be clones of Java. I don’t know which one copied the other, but IMHO they are both trying to build applications the wrong way
  • Adobe has fewer classes but with higher level functionality – generally, I prefer the Adobe approach
  • WPF looks better on Vista – Vista is my development platform, and (not surprisingly), WPF has better looking text and graphics. Of course, Flash is available on other platforms where WPF doen’t run
  • Flash seems to load faster – I am amazed at how quickly Vst in Flash loads, both on my system and other Windows XP systems where I have tested it
  • WPF has 3D graphics – AFIK, Flash does not support 3D – for the vast majority of applications, it probably doesn’t matter
  • WPF has multi-threading – Flash seems to be able to process server requests in the background, so maybe this is not too important. I still don’t know enough about Flash yet to fully understand its capabilities or limitations in this area

Another “Accordion” Demo

Filed under: Adobe, Lisp — pfisk @ 7:29 pm

lisptest11
Vista Smalltalk Site

This is an extension of the first “Accordion” demo – in this case the main window is divided into three regions by means of “HDividedBox” and “VDividedBox” containers. To run the demo, open a Lisp workspace, highlight “(@open AccordionDemo2)”, and select “Do It” or “Show It” from the context menu (open Vista Smalltalk in your browser by clicking this link).

One of the advantages of having a real programming language running in the browser is that interface layout becomes much simpler. In this case, I created a class method for “Accordion” and then called it three times to fill the appropriate regions. The entire Lisp code for the demos is on the main Vista Smalltalk site.

Below is the part of the code for generating the above demo:

(lambda()
  (let ((h nil) (v nil) (w nil))
  (setq w (@open- SizeableTitleWindow “Accordion Demo 2″))
  (setq h (@new HDividedBox))
  (setq v (@new VDividedBox))
  (@addchild- h (@test Accordion))
  (@addchild- h (@test Accordion))
  (@addchild- v h)
  (@addchild- v (@test Accordion))
  (@width- w (* 1.5 (@width w)))
  (@addchild- w v)
  w)))

Blog at WordPress.com.