svg 透视
来源:互联网 发布:风火轮软件 编辑:程序博客网 时间:2024/05/21 10:14
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg style="width: 1000px; height: 600px; border: 1px solid red;"
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
onload='init(evt)'>
<style>
.edge{
fill: white;
stroke: black;
stroke-width: 1;
}
.button{
fill: #2060dd;
stroke: #2580ff;
stroke-width: 1;
}
.button:hover{
stroke-width: 3;
}
</style>
<script type='text/ecmascript'>
<![CDATA[
edges = [[0,1],[2,3],[0,2],[1,3],[4,5],[6,7],[4,6],[5,7],[0,4],[1,5],[2,6],[3,7]]
x_coords = [450,550,450,550,505,595,505,595];
y_coords = [460,460,560,560,415,415,505,505];
z_coords = [0,0,0,0,100,100,100,100];
centre_x = 1000;
centre_y = 500;
centre_z = 50;
function init(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
drawBox();
}
function drawBox()
{
for(var i=0; i<edges.length; i++)
{
edge = svgDocument.getElementById('edge-'+i);
edge.setAttributeNS(null, 'x1', x_coords[edges[i][0]]);
edge.setAttributeNS(null, 'x2', x_coords[edges[i][1]]);
edge.setAttributeNS(null, 'y1', y_coords[edges[i][0]]);
edge.setAttributeNS(null, 'y2', y_coords[edges[i][1]]);
}
}
function moveAboutX(radians)
{
for(var i=0; i<x_coords.length; i++)
{
x_coords[i] = x_coords[i] + 10*radians;
}
for(var i=4; i<x_coords.length; i++)
{
x_coords[i] = x_coords[i] - radians;
}
drawBox();
}
function beginMoveX(radians)
{
moveAboutX(radians);
moveX_timeout = setInterval("moveAboutX(" + radians + ")", 20);
}
function endMoveX()
{
if (typeof(moveX_timeout) != "undefined")
{
clearTimeout(moveX_timeout);
}
}
]]>
</script>
<rect x="505" y="415" width="90" height="90" style="fill: yellow; stroke: #888; opacity: .6;" />
<polygon points="450 460 550 460595 415 505 415" style="fill: orange; stroke: #888; opacity: .6;" />
<polygon points="450 460 450 560505 505 505 415" style="fill: green; stroke: #888; opacity: .6;" />
<polygon points="550 460 550 560595 505 595 415" style="fill: blue; stroke: #888; opacity: .6;" />
<polygon points="450 560 550 560595 505 505 505" style="fill: black; stroke: #888; opacity: .6;" /> -->
<rect x="450" y="460" width="100" height="100" style="fill: red; stroke: #888; opacity: .6;" />
<line x1="0" y1="10" x2="1000" y2="10" style="fill: red; stroke: #ccf;" />
<circle cx="1000" cy="10" r="2" style="fill: red;" />
<line x1="1000" y1="10" x2="450" y2="560" style="fill: red; stroke: #ccf;" />
<line x1="1000" y1="10" x2="450" y2="460" style="fill: red; stroke: #ccf;" />
<line x1='1000' y1='10' x2='550' y2='560' style="fill: red; stroke: #ccf;" />
<line id='edge-0' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-1' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-2' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-3' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-4' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-5' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-6' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-7' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-8' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-9' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-10' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-11' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<path class="button"
d="m 30 465 15 -15 0 8 45 0 0 14 -45 0 0 8 z"
onmousedown='beginMoveX(-0.1)'
onmouseout='endMoveX()'
onmouseup='endMoveX()'/>
<path class="button"
d="m 970 465 -15 -15 0 8 -45 0 0 14 45 0 0 8 z"
onmousedown='beginMoveX(0.1)'
onmouseout='endMoveX()'
onmouseup='endMoveX()'/>
</svg>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg style="width: 1000px; height: 600px; border: 1px solid red;"
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
onload='init(evt)'>
<style>
.edge{
fill: white;
stroke: black;
stroke-width: 1;
}
.button{
fill: #2060dd;
stroke: #2580ff;
stroke-width: 1;
}
.button:hover{
stroke-width: 3;
}
</style>
<script type='text/ecmascript'>
<![CDATA[
edges = [[0,1],[2,3],[0,2],[1,3],[4,5],[6,7],[4,6],[5,7],[0,4],[1,5],[2,6],[3,7]]
x_coords = [450,550,450,550,505,595,505,595];
y_coords = [460,460,560,560,415,415,505,505];
z_coords = [0,0,0,0,100,100,100,100];
centre_x = 1000;
centre_y = 500;
centre_z = 50;
function init(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
drawBox();
}
function drawBox()
{
for(var i=0; i<edges.length; i++)
{
edge = svgDocument.getElementById('edge-'+i);
edge.setAttributeNS(null, 'x1', x_coords[edges[i][0]]);
edge.setAttributeNS(null, 'x2', x_coords[edges[i][1]]);
edge.setAttributeNS(null, 'y1', y_coords[edges[i][0]]);
edge.setAttributeNS(null, 'y2', y_coords[edges[i][1]]);
}
}
function moveAboutX(radians)
{
for(var i=0; i<x_coords.length; i++)
{
x_coords[i] = x_coords[i] + 10*radians;
}
for(var i=4; i<x_coords.length; i++)
{
x_coords[i] = x_coords[i] - radians;
}
drawBox();
}
function beginMoveX(radians)
{
moveAboutX(radians);
moveX_timeout = setInterval("moveAboutX(" + radians + ")", 20);
}
function endMoveX()
{
if (typeof(moveX_timeout) != "undefined")
{
clearTimeout(moveX_timeout);
}
}
]]>
</script>
<rect x="505" y="415" width="90" height="90" style="fill: yellow; stroke: #888; opacity: .6;" />
<polygon points="450 460 550 460595 415 505 415" style="fill: orange; stroke: #888; opacity: .6;" />
<polygon points="450 460 450 560505 505 505 415" style="fill: green; stroke: #888; opacity: .6;" />
<polygon points="550 460 550 560595 505 595 415" style="fill: blue; stroke: #888; opacity: .6;" />
<polygon points="450 560 550 560595 505 505 505" style="fill: black; stroke: #888; opacity: .6;" /> -->
<rect x="450" y="460" width="100" height="100" style="fill: red; stroke: #888; opacity: .6;" />
<line x1="0" y1="10" x2="1000" y2="10" style="fill: red; stroke: #ccf;" />
<circle cx="1000" cy="10" r="2" style="fill: red;" />
<line x1="1000" y1="10" x2="450" y2="560" style="fill: red; stroke: #ccf;" />
<line x1="1000" y1="10" x2="450" y2="460" style="fill: red; stroke: #ccf;" />
<line x1='1000' y1='10' x2='550' y2='560' style="fill: red; stroke: #ccf;" />
<line id='edge-0' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-1' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-2' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-3' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-4' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-5' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-6' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-7' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-8' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-9' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-10' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<line id='edge-11' class='edge' x1='200' y1='200' x2='200' y2='200'/>
<path class="button"
d="m 30 465 15 -15 0 8 45 0 0 14 -45 0 0 8 z"
onmousedown='beginMoveX(-0.1)'
onmouseout='endMoveX()'
onmouseup='endMoveX()'/>
<path class="button"
d="m 970 465 -15 -15 0 8 -45 0 0 14 45 0 0 8 z"
onmousedown='beginMoveX(0.1)'
onmouseout='endMoveX()'
onmouseup='endMoveX()'/>
</svg>
0 0
- svg 透视
- 向KDE4之路(一):SVG透视技术
- 透视
- 透视
- svg
- SVG
- SVG
- SVG
- SVG
- SVG
- svg
- svg
- SVG
- SVG
- SVG
- SVG
- SVG
- svg
- 从MVC和三层架构说到ssh整合开发(下)
- 第五章 信用评分模型的开发流程
- notepad++设置用空格取代tab键及修改背景主题
- struts1和spring的整合
- 434. Number of Segments in a String
- svg 透视
- 类和对象的关系
- Python--matplotlib绘图可视化知识点整理
- jqery easyui 给角色分配菜单 利用tree来实现
- 这些警告如何消除
- OpenCV249和VS2010配置
- 网易2017实习生笔试编程题-魔力手环
- spark 数据倾斜解决方案 (二)聚合源数据以及过滤导致倾斜的key
- cocos2d默认创建的HelloWorld是竖屏