decomp实现拖拽将2d多边形分解示例代码
代码语言:html
所属分类:拖放
代码描述:decomp实现拖拽将2d多边形分解示例代码
代码标签: decomp 拖拽 将 2d 多边形 分解 示例 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <title>poly-decomp.js</title> <style> * { margin:0; padding:0; -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Chrome/Safari/Opera */ -khtml-user-select: none; /* Konqueror */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; /* Non-prefixed version, currently not supported by any browser */ } body { margin: 0px; padding: 0px; overflow: hidden; font: 13px Helvetica, arial, freesans, clean, sans-serif; } p, h1 { margin-bottom: 5px; } h1 a { text-decoration: none; } a { color: black; text-decoration: underline; } #info { display: block; background-color:#eee; padding:10px; } canvas { width: 100%; height: 100%; } </style> </head> <body> <div id="info"> <h1><a href="https://github.com/schteppe/poly-decomp.js">poly-decomp.js</a></h1> <p>Decomposition of 2D polygons into convex pieces in JavaScript. See the <a href="https://github.com/schteppe/poly-decomp.js">Github repo</a>.</p> <p>Try drawing a polygon below!</p> </div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/decomp.min.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/dat.gui-min.js"></script> <script> var demoPolygons = [ { "name": "BayazitCase1", "data": [ [192,40], [32,48], [78,154], [118,108], [160,150] ] }, { "name": "BayazitCase2", "data": [ [125,52], [161,104], [202,52], [268,90], [260,188], [202,2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0