W3C home > Mailing lists > Public > www-svg@w3.org > December 2001

RE: SVG Coordinate System

From: Max Dunn <maxdunn@siliconpublishing.com>
Date: Thu, 13 Dec 2001 14:33:58 -0800
To: "'Bruce Carson'" <bac@world.std.com>, <www-svg@w3.org>
Message-ID: <004801c18426$44190a80$6f4afea9@spi>
To quote Kevin Lindsey from the Yahoo SVG-Developers group
(http://groups.yahoo.com/group/svg-developers ), where this question
just came up:

The easy answer is to enclose your shapes in a <g> element. Add a
translation to move the origin down and then mirror the y-axis.

<g transform="translate(0,3) scale(1, -1)">
<polygon points="0,0 7,0 0,3" fill="red"/>

The tricky part is determining how far you want to translate down. You
need to decide if you want to move the image to the bottom of the SVG
window or
if you simply want to flip the image in place. If you know these values
hand, then you can hard-code the translation; otherwise, you will have
resort to a script to initialize everything at startup.


-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Bruce Carson
Sent: Thursday, December 13, 2001 1:34 PM
To: www-svg@w3.org
Subject: SVG Coordinate System

SVG's default coordinate system has Y-coordinates that increase from top
to bottom.  Is there a way to reverse the coordinate system
such that the Origin is at the bottom and Y-coordinates increase towards
the top of the screen?

Received on Thursday, 13 December 2001 17:27:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:51 UTC