Welcome to the personal website of Dr. Andrew Marsh ...
This site is basically my online notebook, containing an eclectic mix of ideas, discussions and experiments in building performance analysis, generative design, computer programming, data visualisation and web development - all organised under the following two primary themes:
Performative Design... Informative Design...

Fast 3D Vector Text in Processing

Open /scripts/analysis-and-simulation/fast-3d-vector-text-in-processing

Technical illustrations and 3D graphs tend to need lots of different kinds of text - some bold/italic, some large/small, and often in a range of different colors or shades of gray. Having struggled with image-based font glyphs for ages, I've finally had enough so set out to develop my own parametric vector text in Processing/OpenGL. Font glyphs are okay for most things, but small text often lacks definition and is difficult to read, but you want to keep most of your text small so as not to unnecessarily obscure other information. Also, tablet CPUs are slow and, when you have lots of text/annotation, invoking a display list for each character is a noticeable overhead. However, with vector text, you can easily cache all their line segments and pump them to the GPU using vertex buffer objects with just a few OpenGL calls. This applet is a demo of some of the types of 3D text object I've been playing with as well as some experiments with annotation arrows.

Music Composition with Reason

Open /blog/andrew/music-composition-with-reason

I recently upgraded from Reason 4 to Reason 6 and had a bit of time over Christmas for some remixing and further experiments with PropellerHead Reason. Okay, I know what you are thinking, but I do have history here as I used to have a great MIDI setup in the late 80s and early 90s when I was a student. I've had Reason 4 for a while, but never the time to properly finish a piece before. They're not everyone's cup of tea, but if you are interested in a little electronic music...

Dynamically Dimensioning 3D Models

Open /scripts/analysis-and-simulation/dynamically-dimensioning-3d-models

When interactively manipulating objects in 3D, having clear dimensions that update dynamically while dragging around allows for much greater confidence and accuracy in the process. This is especially true on a tablet where accurate alignment is well near impossible as your finger (and sometimes hand) effectively obscures the drag point. However, what started out as a quick experiment ended up sucking me into a 6 day vortex, swirling around with quaternion maths and 3D text manipulation in an attempt to get radial dimensions visible when viewed from any direction. This tiny applet is the result of those 6 days.

A gluUnproject() Function for P3D and OPENGL Sketches

Open /scripts/analysis-and-simulation/gluunproject-function-for-p3d-and-opengl-sketches

I have been struggling for a while in Processing with the reverse projection of 2D screen coordinates back into 3D world coordinates. It's relatively straightforward in OPENGL sketches using the JOGL view matrices and the GLU.gluUnproject() function. However, I could never get anything solid when using the P3D renderer or the PGraphics3D matrices. For some reason there was always a slight scaling issue which varied with different views. Previously I've used fudge factors to get it pretty close but, as I still prefer P3D for browser embedded work, I finally spent some time on it and made the breakthrough I needed. This is a brief description of what I learnt along the way as well as a demo applet and custom gluUnproject() function.

Analytical Space Inspection

Open /scripts/analysis-and-simulation/analytical-space-inspection

When dealing with complex analytical models, visually checking that all the spaces within a building have been generated correctly is never easy. This is because there are usually so many of them and their bounding surfaces are invariably adjacent to those of other spaces. You often wish that there was a way to 'explode' the building apart so you could see all of its constituent parts. Well, this the first of my experiments to do exactly that. As most analytical models don't define their spaces by storey, even though formats like gbXML allow it, there is actually quite a bit of work involved in generating that structure. There is even more work in managing the positions and animations. Thus, whilst later experiments will use springs and dampers to also separate spaces laterally, this one is just vertical separation.

Super Shapes Generator

Open /scripts/analysis-and-simulation/super-shapes-generator

Having just done the Spherical Harmonics demo, and with most of the infrastructure already in place, it would have been remiss not to do a Super Shapes demo. Super Shapes are 3D forms generated using Johan Gielis' generalisation of the superellipse formula, often termed the superformula. This was proposed in 2003 as a framework for simulating natural forms and is basically an equation with four input paramaters that generate a range of natural polygons. Two superformula (hence eight parameters) are used to generate complex 3D forms. By modulating the radius and/or Z coordinates, it can also create shells, spirals and helixes.

Spherical Harmonics Shape Generator

Open /scripts/analysis-and-simulation/spherical-harmonics-shape-generator

I have recently been looking at the use of spherical harmonics as a way of doing real-time diffuse lighting and shadowing effects in OpenGL. As I usually only really understand stuff when I can see it, I did a quick viewer in Processing to help make sure I was getting all the algorithms correct. Some of the visualisations and shapes started to look pretty good, so I figured I’d polish it a bit and put it up on my site. Apart from the visuals, spherical harmonics look really interesting as a means to simplify and relatively accurately approximate complex lighting environments.

Surface Shading Demonstration - Take One

Open /scripts/analysis-and-simulation/surface-shading-demonstration-take-one

The intention of this next iteration on the theme of overshadowing was to look at surface shading on a glazing panel. Unfortunately I got a bit bogged down trying to work out interactive design rules for louvres and brise soleil so didn't get as far as I'd have liked over the long weekend. However, I did finish a basic horizontal/vertical shade example and thought I'd put it up as, even though it doesn't yet show the shading effect on the glazing surface, simply being able to drag a shading mask around seems to give some useful insight into the solar apperture and obstruction effects.

Real-Time Site Analysis - For Android

Open /scripts/analysis-and-simulation/real-time-site-analysis-for-android

The latest version of Processing makes exporting sketches directly to Android relatively easy. However, as everyone on the Processing for Android wiki keeps saying, interacting with a mobile app is very different from using a standard mouse and keyboard. My aim has always been to develop and maintain a single code base to serve all platforms, for both libraries and sketches. This update is the first of my attempts to get this happening on my Galaxy Tab, which I use for testing such things.

Real-Time Site Analysis

Open /scripts/analysis-and-simulation/real-time-site-analysis

I often find myself trying to explain the concept of shading masks - typically over the phone which is never easy. Thus I thought I'd try both demonstrating and illustrating the basic ideas in an interactive web app. In the end it turned out far better than I ever thought it would. I managed to get the required ray-tracing working in pretty much real-time. The aim is that, as you interactively manipulate the 3D model or drag the position of the dome around, you can see instantly the resulting overshadowing effects at the dome centre, thus better understanding their relationship.

3D on the Web - Back to Processing...

Finally got some time to play with Processing again. It's been a hugely busy year with work and I have literally had no time to do any of my own stuff - you can see it's more than a year since my last post on this site. But, like many people in the UK, I took vacation time either side of Easter to take advantage of the Royal Wedding and May Day bank holidays. This gave me a bit of breathing space to look at WebGL and basic app development on iPad and Android, something I'd been looking forward to for a while. However, I always keep coming back to Processing.

Real-Time Dynamic Daylighting

Open /scripts/educational/real-time-dynamic-daylighting

Understanding the potential distribution of daylight in a room is a really key design skill. This applet lets you interactively manipulate windows in a room and see the daylight distribution recalculate and update in real-time. This really highlights the cause-and-effect relationships involved and helps develop that understanding. In addition to just showing daylighting, you can also overlay daylight factor protractors or frequency distribution data and see the effects of different surface reflectances on internally reflected light.

Simple Parametric Modelling Experiment

Open /scripts/educational/simple-parametric-modelling-experiment

This applet is an experiment with parametric modelling. The primary focus was the development of an interactive parameter class with a securely bounded range, variable precision, detailed string formatting, tweening/animation support and direct bindings to both the slider and 3D model classes. The result is a simple parametric tower model. This is relatively simple geometry, but I am really quite surprised how fast Java-based graphics can actually be, and this isn't even using OpenGL.

Cosine Law and Surface Incidence

Open /wiki/cosine-law-and-surface-incidence

Surface incidence is governed by the Lambert cosine law. This states that the relative intensity of radiation or light on a surface is equal to the cosine of the angle of incidence, and that the relative area over which it is distributed is the inverse of this value. This applet provides an interactive and highly visual demonstration of this effect on both horizontal and vertical surfaces. You can interactively drag altitude and azimuth angles to see changes in both the distribution area and relative intensity of an incident energy beam. It is particularly interesting to see these effects simultaneously on both surfaces.

Sun-Path Diagram Projection Methods

Open /scripts/educational/sun-path-diagram-projection-methods

Most of the real detail in a sun-path diagram is usually around the horizon. This is where adjacent buildings, trees and other site objects provide the greatest levels of obstruction. To increase detail at these low altitudes, different sun path projection methods can be used to essentially 'squeeze' altitude angles towards the zenith and expand them around the horizon. This applet demonstrates the most common altitude projection methods and shows how they can be mapped in both sky-dome and orthographic sun-path diagrams.