9/6/2007

Morphic 3.0: The Future of the Graphic User Interface

2. Coordinate Systems

2.1 Each morph has a Coordinate System

As I said before, each morph defines a coordinate system. The appearance of the morph, as well as the location of the sub morphs inside it are specified in this coordinate system. This means that if the morph is moved, rotated or resized (actually "zoomed"), there is no need to do any adjustment to the drawing logic or to the sub morphs: The drawing of the morph and its sub morphs will be done properly by the rendering engine, as it does the conversion between coordinate systems. Take a look at the map projections below: No matter which one you chose, the latitude and longitude of your city are the same in all of them.

2.2 Coordinate Systems are objects

There are many possible coordinate systems. Many of them are non-linear. This means that drawing with them does a geometric deformation on the object being drawn. These are some examples from Wikipedia:

(You can read more at http://en.wikipedia.org/wiki/Map_projection)






We should not be limited on which coordinate systems are possible. Besides, for simplicity, coordinate system handling should not be a responsibility for morph themselves. Therefore we need an expandable hierarchy of CoordinateSystem objects. They specify a rule for assigning a pair of numbers, called coordinates, to each point in some space. 

This rule depends on the kind of coordinate system and its bounds, but it also depends on where (and how) the coordinate system is located in some containing space. This Location information is not a defining property of the coordinate system, as it could change anytime. A Location object specifies how a morph (and its coordinate system) is located in some container morph (and its coordinate system). A location includes a position (expressed in the container coordinate system), an extent (also expressed in the container coordinate system) and an angle of rotation.

Location information is external to the morph, and could perhaps be stored elsewhere. I chose to store the Location in the morph because it is the morph that controls it. This means that a morph may decide to move around or rotate by itself.

All the numbers in Locations and CoordinateSystems are Floats, as they are computer representations of real values.


 
 
  © 2006-2007 Juan M. Vuletich