BlogAbout MeGalleryLinksContact

December 8, 2008

A Truck in blender



I have created a Truck in blender for an illustration to my workplace. This is my very first attempt to create something real.

October 9, 2008

Couple of videoes with Linus

I was amazed how fast they become big... You probably know the story :-)

Linus is here 2 months:

And here he is 5 months:

March 4, 2008

Blender on Mac Mini/MacBook with Leopard

There has been (and are) a lot of problems with blender running on a Mac Mini or MacBook with Leopard. The is caused by the onboard Intel graphics cards which seems not to work with double buffering. However it looks like that OpenGL programs does not need this double buffer so I have been through blender's source code and removed the references to it. A build with the modifications are available for download. I'm looking forward to hear what the blender community say about the build. If the feedback are positive I will make a prober patch and submit to blender.

December 8, 2007

Phase One is Extreme

Phase One's products sure look like craftmanship, just take a look at these crazy videos:




December 2, 2007

White balancing

I have created a small flash movie to investigate how color and white balancing works. The slider at the bottom of the movie is used to selected the white color and is a temperature slider.



November 23, 2007

Landwehr on the way

Yes I'm going to be a dad and this is the first picture of the offspring in progress. I feel like I'm looking at a windows install where the progress bar is just not moving fast enough.

October 31, 2007

Picture Perfect Start

I have decided to give XForms a rest and try something completely different. I'm starting to work for a danish company called PhaseOne where I will do image processing. I'm very excited about this as PhaseOne has an excellent professional image processing software. I'm starting just after New Year and ...

I'm hoping for a Picture Perfect Start :-)

June 2, 2007

XForms and sorting

One problem that keeps popping up when creating forms with XForms is the lack of sorting. I wrote a simple sorting extension which was mostly just taken from XSLT and published it on exforms.org. However this is only useful then the XForms implementation has support for the extension and often is will not. But many times there are alternatives and in this blog post I will describe how one can possible do sorting in the Firefox XForms extension.

There is two places where one might want to sort; either in the UI or in the instance it-self. Because of the way XPath works it is difficult to only sort in the UI as it changes the behavior of XPath and might mess up the rest of the context update routine in XForms. Here I will demonstrate how to solve sorting by sorting an instance.

In this example we will have a model which contains two instances:


  1. data document which we want to sort

  2. the stylesheet document

We keep the stylesheet that do the sorting in an instance because it will allow us to change its behavior from XForms by altering attributes and content.

Without futher ado I give you the model:

<xf:model>
<xf:instance id="default-instance">
<data xmlns="">
<item>
<name>B-item</name>
<date>2001-05-03</date>
</item>
<item>
<name>A-item</name>
<date>2005-05-03</date>
</item>
<item>
<name>Z-item</name>
<date>2003-05-03</date>
</item>
<item>
<name>D-item</name>
<date>2002-05-03</date>
</item>
</data>
</xf:instance>

<xf:instance id="stylesheet">
<xsl:stylesheet
xmlns=""
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<data>
<xsl:apply-templates select="data/item">
<xsl:sort type="string" select="name"/>
</xsl:apply-templates>
</data>
</xsl:template>

<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</xf:instance>
</xf:model>

Here the instance we want to sort is the first and we have the XSLT stylesheet for doing the actual sort as the second instance. Now all we need is a script which will take the XSLT stylesheet and the instance, sort and then insert the sorted instance back into the model. Then the model must be updated and that is it. The script for doing this goes as follows:

function sort_instance(id) {
// We get the instance element
var instanceElement = document.getElementById(id);
if (instanceElement!=null) {
// XForms exposes the retrival of the instance document from the model element which *should*
// be the parent for the instance element.
var instance = instanceElement.parentNode.getInstanceDocument(id);
if (instance!=null) {
// Now creating the stylesheet, for this example the stylesheet document is also an instance
// by it can be loaded from many difference sources
var xslDom = instanceElement.parentNode.getInstanceDocument('stylesheet');

// create an XSLTProcessor and attach the stylesheet
var processor = new XSLTProcessor()
processor.importStylesheet(xslDom);

// now we do the sorting transformation
var resultDom = processor.transformToDocument(instance, instance);

// we then move the result info the instance dom
instance.removeChild(instance.documentElement);
instance.appendChild(resultDom.documentElement);

// and performs the updates for XForms
instanceElement.parentNode.rebuild();
instanceElement.parentNode.recalculate();
instanceElement.parentNode.revalidate();
instanceElement.parentNode.refresh();
}
}
}

This script can then be called from e.g. an anchor like <a href="javascript:sort_instance('default-instance')">sort</a>. The full example can be downloaded or tried from here.

March 22, 2007

Picax Web Album

Picax Web AlbumI have created a AJAX library and released it under GPL to be used for publishing Picasa albums on webpages in a simple way. The XML files generated by Picasa is used directly and is attached to the gallery's album tab by adding an entry in another XML file.

I wrote this Picax gallery software for two reasons:

  1. I needed a gallery for my site
  2. I wanted to make a real AJAX application to compare it with XForms/a declarative approach.

Now creating Picax was no problem but even under development I got confused about the element layout because it was created in the script. I kept making the structure in html and then converted that to script. Using a declarative approach I would have been able to directly express the structures and would have made it much simple to extend and maintain the application. For my next project I will redo the Picax in XForms+XHTML and make a real comparison between the two methods.

For now feel free to use the gallery on your site, if you like me, are a user of Picasa and want to publish your pictures on the web.

February 28, 2007

PicoForms Releases New Site

Screenshot of the PicoForms WebSitePicoForms, the company I work for, has released a new website which contains a complete make over of the design but more importantly demos of the products we have. There is a great demo of the MIDP implementation (at PicoForms we call this the Micro Edition Browser) which uses several back-end WebServices to retrieve data directly from the forms using SOAP. There is also a WebStart demo of the Personal Edition Browser, which currently only have one demo form but a good one since it is the Tax Form from the Mozilla XForms Project.

Check it all out on http://picoforms.com.