XML Elves

XML Elves

<community>of XML and SVG Developers</community>


path problems

This is a discussion on path problems within the SVG Questions forums, part of the SVG Forums category; hello all I am having some trouble getting my head around the functionality associated with paths. in this example I ...


Go Back   XML Elves > SVG Forums > SVG Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices


Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2004, 05:46 PM
motheherder
Guest
 
Posts: n/a
Default path problems

hello all

I am having some trouble getting my head around the functionality associated with paths. in this example I am using the animateTransform scale function in an attempt to scale a path so that on the screen it stays in one location and its size increases.

<svg width="100%" height="100%">
<g transform="translate(120 80)">

<path d="M153 334 C153 334 151 334 151 334 C151 339 153 344 156 344
C164 344 171 339 171 334 C171 322 164 314 156 314 C142 314 131 322 131 334 C131 350 142 364 156 364 C175 364 191 350 191 334 C191 311 175 294 156 294 C131 294 111 311 111 334 C111 361 131 384 156 384 C186 384 211 361 211 334 C211 300 186 274 156 274" style="fill:white;stroke:red;stroke-width:2">
<animateTransform attributeType="XML"attributeName="transform" type="scale"
from="0" to="3" dur="5s" fill="freeze"/>


</path>
</g>
</svg>

using a path (above) I am unable to get this result as the path moves diagonally down across the screen as the grid is scaled, however when using a circle (copy and paste the circle code in italics below in place of path to see result) instead of a path I am able to get the result i am after (scales and remains in the same place on the screen)

<circle cx="0" cy="0" r="50" fill="none" stroke-width="15" stroke="#ff00ff" stroke-opacity="0.8"> <animateTransform attributeType="XML" attributeName="transform"
type="scale" from="0" to="3" dur="5s" fill="freeze"/> </circle>


Please could someone explain why I get one result when using a path and another different when using a circle and perhaps suggest a solution.

If anyone has a solution to the final posting in my previous query entitled animateColor I would also be very grateful

Thank you kindly for your assistance with my path dilemmas

mo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-04-2004, 02:00 AM
Anonymous
Guest
 
Posts: n/a
Default path problems

It's not problem with path or circle ...

Scale is always centered in 0,0

As your circle's center is 0,0 you get what you want.
For path, your path begin in 153,334 in scale(3) begining point become 459, 1002, so you see some translation ...
To correct you can change your path as d="M0 0 ................" and put it in place using transform in g element
You can also use relative coordinates in d so only first point must be changed ..

Another solution is to put transform in your path as
<g transform="translate(273 414)">
<path transform="translate(-153 -334)" d="M153 334 .......

and in animateTransform add additive="sum"

Michel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-04-2004, 02:11 AM
Anonymous
Guest
 
Posts: n/a
Default path problems

Sorry ...

I forget that in ASV, transform from animateTransform is apply BEFORE transform defined in element ...

If you keep your d, you have to use two animateTransform ...

This run fine :

<g transform="translate(273 414)">
<path transform="translate(-153 -334)" d="M153 334 C153 334 151 334 151 334 C151 339 153 344 156 344 C164 344 171 339 171 334 C171 322 164 314 156 314 C142 314 131 322 131 334 C131 350 142 364 156 364 C175 364 191 350 191 334 C191 311 175 294 156 294 C131 294 111 311 111 334 C111 361 131 384 156 384 C186 384 211 361 211 334 C211 300 186 274 156 274" style="fill:white;stroke:red;stroke-width:2">
<animateTransform attributeType="XML" attributeName="transform" type="scale" from="0" to="3" dur="10s" fill="freeze"/>
<animateTransform attributeType="XML" attributeName="transform" additive="sum" type="translate" from="-153,-334" to="-153,-334" dur="10s" fill="freeze"/>
</path>
</g>

Michel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-04-2004, 11:51 AM
motheherder
Guest
 
Posts: n/a
Default thank you

Hi Michel

Thanks again for your assistance and time. I had overlooked the translate from and to components.

Kind regards,

mo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
path, problems


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -6. The time now is 02:34 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

Canon Ink Cartridges...
Canon ink cartridges are much cheaper here.

ink jet
Think ink jet ink. Think internet ink. Great value, great brands, great service. Order online to take advantage of our magnificent range!

hard disk drive repair recovery manchester
Data Clinic's hard disk drive data recovery and repair success lead to satisfied customers. We are easy to find in Manchester.

ink cartridges Free UK Delivery on ink cartridges such as Canon, Dell, Epson, hp & Lexmark.

1 2 3 4 5 6 7 8 9 10