Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 30th, 2006, 05:25 PM
M.Barren@gmail.com
Guest
 
Posts: n/a
Default Problem with SVG transformations

Hi,

I'm a newbie in SVG, I've been trying to get the svg below working for
sometime now, I need help:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve" zoomAndPan="disable">

<g transform="translate(10mm,10mm)">
<rect x="0mm" y="0mm" width="100mm" height="30mm"
style="fill:red;stroke:black;stroke-width:1mm"/>
</g>
</svg>

The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?

Any help would be appreciated

  #2  
Old December 1st, 2006, 12:35 AM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Problem with SVG transformations

M.Barren@gmail.com wrote:
Quote:
The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?
Transformation is implemented as a matrix-multiplication operation upon
the coordinates. As such, it is unitless; the units are those of the
original coordinates it is being applied to. See the detailed
descriptions at
http://www.w3.org/TR/SVG11/coords.ht...gANewUserSpace

(If you aren't familiar with matrix math operations, you really should
invest a bit of time in learning about them -- they're a fairly basic
tool for computer graphics work.)



--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
  #3  
Old December 1st, 2006, 12:35 AM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Problem with SVG transformations

Joe Kesselman wrote:
Quote:
the coordinates. As such, it is unitless
.... or at least, that's how I read it. Certainly the scaling columns
have to be unitless (you don't want to multiply cm by cm when the result
is supposed to be cm). I suppose the additive column could and perhaps
should carry units, but I don't see provision for that in the spec. I
may be missing something (and whoever implemented the version you're
using may have missed the same thing I did), but...

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
  #4  
Old December 1st, 2006, 01:45 AM
M.Barren@gmail.com
Guest
 
Posts: n/a
Default Re: Problem with SVG transformations


Joe Kesselman wrote:
Quote:
M.Barren@gmail.com wrote:
Quote:
The "translate(10mm,10mm)" doesn't work unless i get rid of the units.
Without the units, how can I tell it 10 is in mm and not in cm or inch
or pixel or ... ?
>
Transformation is implemented as a matrix-multiplication operation upon
the coordinates. As such, it is unitless; the units are those of the
original coordinates it is being applied to. See the detailed
descriptions at
http://www.w3.org/TR/SVG11/coords.ht...gANewUserSpace
>
(If you aren't familiar with matrix math operations, you really should
invest a bit of time in learning about them -- they're a fairly basic
tool for computer graphics work.)
>
Thanks joe for the the reply,
I have looked into the spec before, not only that page but many other
pages as well and I ended up not finding a solution, I'm familiar with
matrices and if you know a solution, please post a sample svg code to
show that, I'm really frustrated as even a google search on this didn't
get me anywhere.
Thanks in advance

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles