【问题标题】:Find coordinates using circle radius to create shapes使用圆半径查找坐标以创建形状
【发布时间】:2013-07-22 20:18:14
【问题描述】:

我正在使用脚本来创建形状,通常您可以使用图像映射来绘制坐标,但此脚本使用的是圆半径中的坐标。

是否有从圆半径绘制坐标的工具或更好的绘制坐标的方法,例如:

这适用于多边形/星形,很难获得对称的形状。 我将制作其他更复杂的形状

circles.push(new Circle(width / 2 - 70, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 - 250, circleRadius));
circles.push(new Circle(width / 2 + 70, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 + 220, height / 2 - 120, circleRadius));
circles.push(new Circle(width / 2 + 120, height / 2 - 0, circleRadius));
circles.push(new Circle(width / 2 + 180, height / 2 + 180, circleRadius));
circles.push(new Circle(width / 2 - 0, height / 2 + 120, circleRadius));
circles.push(new Circle(width / 2 - 180, height / 2 + 180, circleRadius));
circles.push(new Circle(width / 2 - 120, height / 2 - 0, circleRadius));
circles.push(new Circle(width / 2 - 220, height / 2 - 120, circleRadius));

【问题讨论】:

    标签: javascript coordinates kineticjs geometry shapes


    【解决方案1】:

    您为什么不尝试使用与您需要的形状相同的背景图片,这将帮助您获得完全符合您要求的形状。

    对于你所说的多边形,尝试使用这些坐标,这应该会给你一个更好的形状。

    circles.push(new Circle(width / 2 - 60, height / 2 - 60, circleRadius));
    circles.push(new Circle(width / 2 - 0, height / 2 - 250, circleRadius));
    circles.push(new Circle(width / 2 + 60, height / 2 - 60, circleRadius));
    circles.push(new Circle(width / 2 + 260, height / 2 - 60, circleRadius));
    circles.push(new Circle(width / 2 + 100, height / 2 + 60, circleRadius));
    circles.push(new Circle(width / 2 + 160, height / 2 + 250, circleRadius));
    circles.push(new Circle(width / 2 - 0, height / 2 + 130, circleRadius));
    circles.push(new Circle(width / 2 - 160, height / 2 + 250, circleRadius));
    circles.push(new Circle(width / 2 - 100, height / 2 + 60, circleRadius));
    circles.push(new Circle(width / 2 - 260, height / 2 - 60, circleRadius));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-18
      • 2015-12-29
      • 1970-01-01
      • 1970-01-01
      • 2013-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多