简体   繁体   English

如何用正方形(平铺)创建2D圆?

[英]How do I create a 2D Circle out of squares (tiles)?

So basically what I'm trying to do is generate a circle completely out of square tiles in Unity and I am trying to think about the best way mathematically to generate it. 因此,基本上我想做的是在Unity中完全用正方形瓷砖生成一个圆,并且我正在尝试思考数学上生成它的最佳方法。

In the end, I want it to look something like: 最后,我希望它看起来像:

https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTHh7I_BURo5qMI73YLZVG6PO4WeFtbT--QL_9qOJovpNaWemar https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTHh7I_BURo5qMI73YLZVG6PO4WeFtbT--QL_9qOJovpNaWemar

In this image, the tiles are more rectangular and not all sides are equal, but it gets the point across. 在此图像中,图块更呈矩形,并非所有边都相等,但它可以使点交叉。

Does anyone know of any mathematical formulas or anything that could be helpful in doing this? 有人知道任何数学公式或任何可能有助于这样做的东西吗? I don't necessarily need straight answers (unless you have them :D), but anything to help me along would be appreciated! 我不一定需要简单的答案(除非您有:D),但是任何可以帮助我的问题将不胜感激!

Thanks! 谢谢!

Take the starting point (center) and start drawing your first square in the starting direction. 以起点(中心)为起点,开始绘制第一个正方形。 Now turn the direction with the Golden ratio : 1.618... 现在用黄金比例 :1.618转向...

Keep turning this much for every consecutive square you are drawing, every time increasing the distance from the center a little bit. 对于您要绘制的每个连续的正方形,请保持如此旋转,每次与中心的距离增加一点。

Apparently sunflowers also grow following this pattern according to this video ! 显然,根据此视频,向日葵也按照这种模式生长!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM