在我当前的 OpenGL 项目中,我试图使链条的链接紧贴贝塞尔曲线的轮廓。如何找到曲线上两点之间的角度,以便我可以定位链条的链接,使它们遵循曲线。
Here是曲线和链条的图片,我需要某种方法来旋转链接,以便它们遵循曲线。
这里有人知道怎么做吗?
最佳答案
也许像 this就是您所需要的。
How to calculate the tangent to a Bezier curve
This is hard to find online. It must be a secret closely held by those who know. Oh you can find the math formulae, but have fun interpreting them if you are not a mathematician. So what is a poor developer to do? Go back to school.
I spent a couple days bashing my skull over this one. I googled my brains out (which was easier once my skull was sufficiently bashed). Then one bright beautiful Saturday, I was holed up in my developer's dungeon resting my weary bones. I had the TV on in front of me and Wikipedia to the right and there I was lazily switching between watching them both.
关于opengl - 如何找到贝塞尔曲线上两点之间的角度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1084641/