以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  请各位高手帮忙看一道SVG的题目  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=75305)


--  作者:claireni
--  发布时间:6/8/2009 11:07:00 PM

--  请各位高手帮忙看一道SVG的题目
一个正方形,边是红色的,里面有4个三角形,2个蓝色左边的角上,2个绿色在右边的角上。中间是一个黄色的圆,半径为50.

1. 第3秒的时候,在正方形里。所有的三角形往相反的方向移动,正好移动到圆的里面,正方形的中心位置。同时圆的半径变大为100

2.第6秒的时候,在正方形里。所有三角形继续往相反方向移动到完全相反的位置。同时圆的半径变大为150.

下面是我写的。圆可以变大,但是三角形移动的很不正常。。。。。

<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<rect id="rec" x="300" y="100" width="500" height="500" style="fill:white;stroke-width:1;stroke:red"/>

<g>
<circle cx="550" cy="350" r="50" style="fill:yellow">
<animate attributeName="r" from="50" to="100" begin="0s" dur="3s"/>
</circle>
<animate attributeName="r" from="100" to="150" begin="3s" dur="3s"/>
</g>

<g>
<polygon id="up_left" points="300,200 350,100 400,200" style="fill:blue">
<animatMotion path="M0 0 L200 200" begin="0s" dur="3s"/>
</polygon>
<animateMotion path="M0 0 L200 200" begin="3s" dur="3s"/>
</g>

<g>
<polygon id="up_right" points="700,200 750,100 800,200" style="fill:green">
<animatMotion path="M0 0 L-200 200" begin="0s" dur="3s"/>
</polygon>
<animateMotion path="M0 0 L-200 200" begin="3s" dur="3s"/>
</g>

<g>
<polygon id="down_left" points="300,600 350,500 400,600" style="fill:blue">
<animatMotion path="M0 0 L200 -200" begin="0s" dur="3s"/>
</polygon>
<animateMotion path="M0 0 L200 -200" begin="3s" dur="3s"/>
</g>

<g>
<polygon id="down_left" points="700,600 750,500 800,600" style="fill:green">
<animatMotion path="M0 0 L-200 -200" begin="0s" dur="3s"/>
</polygon>
<animateMotion path="M0 0 L-200 -200" begin="3s" dur="3s"/>
</g>

</svg>


--  作者:vachin
--  发布时间:6/10/2009 12:45:00 PM

--  
<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<rect id="rec" x="300" y="100" width="500" height="500" style="fill:white;stroke-width:1;stroke:red"/>

<g>
<circle cx="550" cy="350" r="50" style="fill:yellow">
<animate attributeName="r" from="50" to="150" begin="0s" dur="6s"/>
</circle>
</g>

<g>
<polygon id="up_left" points="300,200 350,100 400,200" style="fill:blue">
<animateMotion path="M0 0 L400 400" begin="0s" dur="6s"/>
</polygon>
</g>

<g>
<polygon id="up_right" points="700,200 750,100 800,200" style="fill:green">
</polygon>
<animateMotion path="M0 0 L-400 400" begin="0s" dur="6s"/>
</g>

<g>
<polygon id="down_left" points="300,600 350,500 400,600" style="fill:blue">
</polygon>
<animateMotion path="M0 0 L400 -400" begin="0s" dur="6s"/>
</g>

<g>
<polygon id="down_left" points="700,600 750,500 800,600" style="fill:green">
</polygon>
<animateMotion path="M0 0 L-400 -400" begin="0s" dur="6s"/>
</g>

</svg>


--  作者:claireni
--  发布时间:6/10/2009 5:27:00 PM

--  
谢谢谢谢!!!!!

以下是引用vachin在2009-6-10 12:45:00的发言:
<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<rect id="rec" x="300" y="100" width="500" height="500" style="fill:white;stroke-width:1;stroke:red"/>

<g>
<circle cx="550" cy="350" r="50" style="fill:yellow">
<animate attributeName="r" from="50" to="150" begin="0s" dur="6s"/>
</circle>
</g>

<g>
<polygon id="up_left" points="300,200 350,100 400,200" style="fill:blue">
<animateMotion path="M0 0 L400 400" begin="0s" dur="6s"/>
</polygon>
</g>

<g>
<polygon id="up_right" points="700,200 750,100 800,200" style="fill:green">
</polygon>
<animateMotion path="M0 0 L-400 400" begin="0s" dur="6s"/>
</g>

<g>
<polygon id="down_left" points="300,600 350,500 400,600" style="fill:blue">
</polygon>
<animateMotion path="M0 0 L400 -400" begin="0s" dur="6s"/>
</g>

<g>
<polygon id="down_left" points="700,600 750,500 800,600" style="fill:green">
</polygon>
<animateMotion path="M0 0 L-400 -400" begin="0s" dur="6s"/>
</g>

</svg>



--  作者:猫哥猫哥
--  发布时间:7/6/2009 11:42:00 PM

--  
精华啊   不过我已经看过了 哈哈 还是顶下  *^__^*
            
   
     
       
    
    
  
     
      
------------------------------------------------------------
林心如[url=http://www.gw365.com/bjp/qianer/3779.asp]终极瘦身[/url]夜晚,夜晚,发亮的血癌,红野鸡嗉子在火光中溅出烈焰

--  作者:suki8130
--  发布时间:9/21/2009 4:26:00 PM

--  
我是一个刚刚接触svg的初学者,我想问一下你们编写这些代码时直接在文本文档里编写的吗?还是有其他的工具?   还有就是我要编写一个一个柱状图,如何把它弄到正中央显示?希望前辈可以指教一下,谢谢!!
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">


<svg version="1.1" id="chart1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  width="80.566px" height="130.478px" viewBox="0 0 80.566 130.478" enable-background="new 0 0 80.566 130.478"
  xml:space="preserve">


<g>
 <g>
  <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="55.783" y2="119.239"/>
  <g>
   <g>
    <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="6.783" y2="116.764"/>
    <line fill="none" stroke="#000000" x1="55.783" y1="119.239" x2="55.783" y2="116.764"/>
   </g>
  </g>
 </g>
 <g>
  <g>
   <text transform="matrix(1 0 0 1 2.572 120.1003)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">100</text>
   <text transform="matrix(1 0 0 1 3.7205 100.3005)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">80</text>
   <text transform="matrix(1 0 0 1 3.7205 80.5007)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">60</text>
   <text transform="matrix(1 0 0 1 3.7205 60.7)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">40</text>
   <text transform="matrix(1 0 0 1 3.7205 40.9001)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">20</text>
   <text transform="matrix(1 0 0 1 4.8689 21.1003)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">0</text>
  </g>
  <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="6.783" y2="20.239"/>
   <g>
    <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="8.008" y2="119.239"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="99.439" x2="8.008" y2="99.439"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="79.639" x2="8.008" y2="79.639"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="59.839" x2="8.008" y2="59.839"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="40.039" x2="8.008" y2="40.039"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="20.239" x2="8.008" y2="20.239"/>
   </g>
  </g>
 <g>

<rect x="13.643" y="20.239" stroke="#000000" stroke-width="0.5" width="35.28" height="99" id = "bar1"/>
   </g>
 </g>


<text transform="matrix(1 0 0 1 6.03 127.8806)" font-family="'ArialMT'" font-size="8" id="text0">Number</text>
<text transform="matrix(1 0 0 1 73.616 129.24)" font-family="'ArialMT'" font-size="8" id="text1">0</text>
</svg>


--  作者:tamefox
--  发布时间:9/24/2009 11:01:00 PM

--  改动了一点,不知是否满足你的要求
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="chart1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<g transform="translate(400,100) scale(2)">
<g>
<g>
  <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="55.783" y2="119.239"/>
  <g>
   <g>
    <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="6.783" y2="116.764"/>
    <line fill="none" stroke="#000000" x1="55.783" y1="119.239" x2="55.783" y2="116.764"/>
   </g>
  </g>
</g>
<g>
  <g>
   <text transform="matrix(1 0 0 1 2.572 120.1003)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">100</text>
   <text transform="matrix(1 0 0 1 3.7205 100.3005)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">80</text>
   <text transform="matrix(1 0 0 1 3.7205 80.5007)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">60</text>
   <text transform="matrix(1 0 0 1 3.7205 60.7)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">40</text>
   <text transform="matrix(1 0 0 1 3.7205 40.9001)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">20</text>
   <text transform="matrix(1 0 0 1 4.8689 21.1003)" font-family="'AdobeSongStd-Light-GBpc-EUC-H'" font-size="2.2969">0</text>
  </g>
  <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="6.783" y2="20.239"/>
   <g>
    <line fill="none" stroke="#000000" x1="6.783" y1="119.239" x2="8.008" y2="119.239"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="99.439" x2="8.008" y2="99.439"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="79.639" x2="8.008" y2="79.639"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="59.839" x2="8.008" y2="59.839"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="40.039" x2="8.008" y2="40.039"/>
    <line fill="none" stroke="#000000" x1="6.783" y1="20.239" x2="8.008" y2="20.239"/>
   </g>
  </g>
<g>
<rect x="13.643" y="20.239" stroke="#000000" stroke-width="0.5" width="35.28" height="99" id = "bar1"/>
   </g>
</g>
<text transform="matrix(1 0 0 1 6.03 127.8806)" font-family="'ArialMT'" font-size="8" id="text0">Number</text>
<text transform="matrix(1 0 0 1 73.616 129.24)" font-family="'ArialMT'" font-size="8" id="text1">0</text>
</g>
</svg>
--  作者:suki8130
--  发布时间:9/28/2009 11:37:00 PM

--  
非常感谢啊,我想问一下你用什么对SVG进行编写,还有就是可不可以介绍一下你学习SVG的心得啊??
--  作者:suki8130
--  发布时间:10/12/2009 10:44:00 AM

--  请教
非常感谢啊,我想问一下你用什么对SVG进行编写,我用文本文档进行编写,每次修改代码都要另存很麻烦?还有就是可不可以介绍一下你学习SVG的心得啊??
--  作者:tamefox
--  发布时间:10/15/2009 9:18:00 AM

--  
实在谈不上请教,我之所以没回答就是怕自己班门弄斧。。
我编辑svg都用xmlspy,本站就有,你可以下载
http://bbs.xml.org.cn/dispbbs.asp?boardID=35&ID=6191
学习SVG主要是看别人的作品,需要什么,就从别人的作品中抠出来,为己所用。其实不光是SVG,学习计算机编程基本都是这样。如果有什么问题可以单独发帖~毕竟这个话题和一楼求助的内容不太搭~
--  作者:karmib
--  发布时间:5/20/2010 12:47:00 PM

--  How to write a XSLT for this XML?
hi friend i have a code as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="100%" height="100%" viewBox="0 0 214.819 278.002">
 <g id="Standard_x0020_layer">
<g id="Catalog">
  <line stroke-width="0.353" stroke-linecap="butt" x1="5.839" y1="262.185" x2="209.039" y2="262.185"/>
  <text transform="matrix(0.984 0 0 0.93 183.515 265.271)" stroke="none" fill="#000000" font-family="'Helvetica'" font-size="3.174"/>
  <text transform="matrix(0.994 0 0 0.93 7.235 265.3)" stroke="none" fill="#000000" font-family="'Helvetica'" font-size="3.174">087156-8-</text>
<g>
   <path stroke="none" fill="#000000" d="M26.507 12.628L26.507 4.977 28.599 4.977 28.599 10.673 30.946 10.673 30.946 12.628 26.507 12.628z"/>
   <path stroke="none" fill="#000000" d="M19.693 12.628L19.693 4.977 21.785 4.977 21.785 7.66 23.893 7.66 23.893 4.977 25.986 4.977 25.986 12.628 23.893 12.628 23.893 9.782 21.785 9.782 21.785 12.628 19.693 12.628z"/>
   <path stroke="none" fill="#000000" d="M12.587 4.977L9.566 8.621 13.019 12.631 10.25 12.63 7.905 9.9 7.9 9.9 7.9 12.628 5.81 12.628 5.81 4.977 7.9 4.977 7.9 7.267 7.884 7.27 9.875 4.977 12.587 4.977z"/>
</g>
<line stroke-width="0.353" stroke-linecap="butt" x1="5.839" y1="20.455" x2="209.039" y2="20.455"/>
  <g>
   <text transform="matrix(0.996 0 0 0.93 71.95 255.181)" stroke="none" fill="#000000" font-family="'Helvetica'" font-size="2.822" font-weight="bold">**Finish/color code must be specified when ordering.</text>
</g>
</g>
</svg>

how can i generate xsl-fo style sheet for the above xml file please help me..please mail me kart_5555@co.in  please help me


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
94.727ms