Monday, July 27, 2009

Wumpus

Copperbox revision 712.

I've removed all the 'Co' data types - CoLineSegment, CoCurve - that were functions from Point -> ...

The classic functional way of describing continuous images is type Image = Point -> Colour - this is used in Clastic, Chalkboard (with minor differences), Conal Elliott's Pan, and other programs. For continuous images the Image type can be seen as a generalization of the characteristic function (e.g type Shape = Point -> Bool) that indicates whether a point is within the boundary of a shape.

The Image type is a natural fit for continuous images - it essentially captures the type of a rendering function. But it doesn't seem to be as directly useful for discrete images built from vector primitives (in my case - PostScript). In Clastic images genuinely are functions, whereas in Wumpus they were only functions in so much as a they allowed a certain coordinate free style. For instance, generating horizontal lines could be a function hline :: Length -> (Point -> LineSegment), but line segments were always represented concretely by their start and end points. I could change to represent lines as equations, but that would have problems for rendering especially if I do the same for curves - lines would need discovering (as in polygonization and ray-tracing).

Note - I haven't changed the Picture type yet as it is more fully realized - it was 'borrowed' from the Picture type in Haven.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.