Hello,

In graphics code, I like to use words like 'top', 'bottom', 'above', 'below', 
etc for comparing the relative location of objects.

Words like 'left', 'right', 'left-of', 'right-of', work fine because the 
default coordinate system in the ui has 'X' increasing to the right.

But the vertical words cause some problems. For example, the documentation 
for 'rect' says:

  - rect-loc - the top-left corner of the rectangle as an x/y pair

Of course, the ui is opengl based, so it's very easy to change the coordinate 
system such that Y increases upwards. But then if I want to use the 'rect' 
class in my code, the words that talk about 'top' and 'bottom' are no longer 
valid.

So what's the right thing to do?

Should I not use the system provided 'math.geometry.rect' class and instead 
define my own which has words which make sense in a Y-increases-up CS?

Here are my rules for these words:

    top should always refer to the largest y value

    above should always refer to the bigger y value

Similar for bottom/below.

At this point I think the best thing is to use my own shape classes
(e.g. rect) which are desiged with the Y-increases-up CS. But it's not a good 
thing to have this kind of duplication...

One idea I threw out there in the past was to have the default ui cs be such 
that Y increases upwards and have the origin at the lower left corner. 
Besides the inconvenience of changing the ui code, I'm not sure of the 
arguments for and against this issue.

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to