簡體   English   中英

使用圓半徑查找坐標以創建形狀

[英]Find coordinates using circle radius to create shapes

我使用腳本來創建形狀,通常可以使用圖像貼圖來繪制坐標,但是此腳本使用的是圓半徑的坐標。

是否有工具可以從圓半徑繪制坐標,或者有更好的坐標繪制方法,例如:

這是用於多邊形/星形形狀,很難使形狀對稱。 我將制作其他更復雜的形狀

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));

您為什么不嘗試使用與所需形狀相同的背景圖像,這將幫助您准確獲得所需形狀。

對於您所說的多邊形,請嘗試使用這些坐標,這將為您提供更好的形狀。

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));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM