- From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
- Date: Tue, 12 Dec 2000 12:18:07 -0500
- To: "Jon Ferraiolo" <jferraio@Adobe.COM>
- Cc: www-svg@w3.org
At 8:37 PM -0800 12/11/00, Jon Ferraiolo wrote: >Elliotte, >I am following up with some sample code: > ><svg x="0" y="0" width="1cm" height="1cm" > viewBox="0 0 1000 1000" > style="overflow:visible"> > <rect x="1000" y="1000" width="3000" height="3000" style="fill:red"/> ></svg> > >The above code is just one way to approach the problem. I'll explain >what the above code does: > >The first line: > (a) specifies (via the 'width' and 'height' attributes) a >viewing region that is 1cm by 1cm > (b) specifies (via the 'viewBox' attribute) that user coordinate >(0,0) maps to the top/left of the viewing region and user coordinate >(1000,1000) maps to the bottom right of the viewing region (i.e., >the location that is 1cm down and to the right of the origin) > (c) specifies (via overflow:visible) that there should be no >automatic clipping at the bounds of the viewing region > Thanks. I'm slowly getting this. So if I understand there are two coordinate spaces in an SVG document: 1. The local, user coordinates, an infinite plane of non-dimensional numbers 2. The viewBox coordinates, that merely maps the user coordinates onto the local screen right now. All items specified with units, be they pixels, centimeters, inches, or anything else are in viewBox coordinates. I'm asking for a third set of coordinates which could be mapped to the first two: 3. Real world coordinates, which reflect the actual physical dimensions of the objects being modeled and always have units; and I'd like dimensional numbers specifying the width, height, position, etc. of shapes to be given in real-world units; and an option to set the width and height of the svg element as a percentage of the real world units. This is more or less how VRML works. This allows a chair I design to be placed in the living room you design with a reasonable degree of certainty that my chair won't be bigger than your living room. Does SVG really have no way of doing this? It seems so obviously necessary to me, but maybe it's just outside the problem domain SVG is trying to address. -- +-----------------------+------------------------+-------------------+ | Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer | +-----------------------+------------------------+-------------------+ | The XML Bible (IDG Books, 1999) | | http://metalab.unc.edu/xml/books/bible/ | | http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ | +----------------------------------+---------------------------------+ | Read Cafe au Lait for Java News: http://metalab.unc.edu/javafaq/ | | Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/ | +----------------------------------+---------------------------------+
Received on Tuesday, 12 December 2000 12:21:21 UTC