Sunday, March 28, 2010

Chrome and Virtual Desktop Manager

Now that I have my new laptop, I decided it was time to find a better virtual desktop manager. I had been using the creatively named Virtual Desktop Manager with mostly good experiences, but a few quirks. One of the more annoying ones is artifacts that occur sometimes, but are persistent, when switching from a desktop with Chrome to one without. After a few days of uptime, I would find ghostly outlines of Chrome windows on all my desktops, and sometimes even orphaned status messages of the variety you get in the bottom left of the browser window when you mouse over a link or are loading a page. Pretty annoying! The second quirk is a blank and non-responsive "Write (no subject)" window courtesy of Thunderbird when you compose an e-mail and switch desktops before sending it.

Anyway, all that has been resolved with the use of Dexpot, I heartily recommend it.

Two Finger Click and Scroll

One of the (many) things that Apple get right on their Macbooks is the touch pad, it is large and supports nice multi-touch gestures.

My new laptop, an Asus G73, features the nice large touch pad and supports multi-touch gestures, like pinch-zoom, but it misses the best two gestures - two-finger scroll and two-finger tap to right-click. Fortunately, there is a remedy to this deficiency: Two-Finger-Scroll. So now I get the Macbook quality touch pad experience with twice the cores, way better graphics and more than enough money left over for a fast ssd!

Monday, March 15, 2010

Java3D offscreen rendering and changing colours

I just ran into an irritating quirk (perhaps bug?) in Java3D. I'm using the offscreen rendering feature of Canvas3D to render a simple 3D scene to a PNG file. The requirement is simply to produce a PNG given certain input parameters, notably colour.

My first attempt was very straight-forward; create my scene, with the correct colours and render it to the PNG. Repeat as required. The last part, repeat as required, is problematic. Each time you create an offscreen Canvas3D you create an OpenGL PBuffer. My graphics card as 32 pbuffers so the 33rd time you render the scene, the program crashes.

A second attempt is obviously required. The requirement being to use only one Canvas3D object and thus only one scene graph and to change the colour of the scene before re-rendering it. First, some background, my objects are Boxes and to set their colour you have to set an appropriately configured Appearance. For example:
final Material material = new Material();
final Appearance appearance = new Appearance();
final Box cube = new Box(1, 1, 1, appearance);


material.setDiffuseColor(someColor);
appearance.setMaterial(material);
This simply creates a cube using the Box utility class and sets a color on it. Java3D will optimize the scene graph and part of that optimization assumes that the scene doesn't change, unless you explicitly state that it can. Changing the colour would be one of those things you have to state. There are plenty of forum topics about changing the colour of a Box and they usually suggest changing the Appearance object, like so:
final Box cube = new Box(1, 1, 1, Box.ENABLE_APPEARANCE_MODIFY, someAppearance);


[...] // Some time later
box.setAppearance(aDifferentAppearance);
The ENABLE_APPEARANCE_MODIFY flag simply tells Java3D to assume that the Appearance object associated with the Box can change. This should allow you to change the appearance at will. Except in offscreen rendering mode, this doesn't work. Not only does it not work, but any initial colour you set is ignored and you get a white Box. After much messing about, I found that ENABLE_APPEARANCE_MODIFY was the cause. The solution to this is to change the colour on the material directly and not simply set a new Apperance.
final Material material = new Material();
final Appearance appearance = new Appearance();
final Box cube = new Box(1, 1, 1, appearance);


material.setCapability(Material.ALLOW_COMPONENT_WRITE);
material.setDiffuseColor(someColor);
appearance.setMaterial(material);
[...] // Some time later
material.setDiffuseColor(aDifferentColor);
And there you have it, Boxes that change colour in an offscreen rendered scene.

Wednesday, March 3, 2010

Red Rings Again and for the Last Time

Once again, my Xbox 360 has been hit with the 3 Red Rings of Death error. Once again, I called Microsoft only to be told that it was out of warranty this time around and it would cost me $150 to repair it. After explaining my history, this was my 4th console after all, they graciously offered to repair it for free. The catch is that I had to get it to a UPS store myself which isn't anywhere near me.

Well, I got the console back again this last Monday and got 4 Red Rings this time. Called support again, they were willing to repair it but when they mentioned I would have to get it back to the UPS store, I decided enough is enough. The customer service representative explained that my preferred courier was indeed supported, i.e., the one that is just a few blocks away and the same one I received the latest damaged console from, but that the Xbox support system was randomly generating labels to even out the various couriers Microsoft uses. I politely asked for a label from another courier and was told there was nothing they could do.

So this will be the last time I have issues with Red Rings. The games, accessories, etc., are heading to EB Games and the console is headed to the garbage bin. Fool me once Microsoft... but I've had enough.