问题描述
我需要找到2点的视觉地平线曲面的的。
我有:
- 的4个角点的XYZ
- 2弧形边缘贝塞尔点的XYZ
和我需要计算两种:
- 2地平线点XY
- 2地平线分XYZ
注意:我得到一个解决方案最后时间我问过这个问题,但只找到的极值的的曲线,而不是的地平线点的,它改变的基础上两条曲线的位置和旋转在相对于彼此
Note: I got a solution the last time I asked this question, but it only found the extrema of the curves, not the horizon points, which changes based on the position and rotation of both curves in respect to each other.
推荐答案
您怎么不说你的面被定义,只知道它是由两个二次贝塞尔曲线的限制。有很多方法来建立这样的表面,并建立将有一个不同的地平线每程。因此,这个答案将是猜测。
You don't say how your surface is defined, only that it is bounded by two quadratic Bézier curves. There are lots of ways to build such a surface, and each way of building it would have a different horizon. So this answer is going to be guesswork.
地平线包括表面,从摄像机到该点的矢量相切表面上的这些点,如下所示:
The horizon consists of those points on the surface where the vector from the camera to the point is tangent to the surface, as shown here:
二次贝塞尔曲线参数方程
A quadratic Bézier curve has parametric equation
B( T 的)=(1 - 的 T ) P 0 + 2(1 - T ) T P 1 + T 的 P + 2(1 − t)t P + t P
微分,关于吨使我们有相切的曲线:
differentiating that with respect to t gives us the tangent to the curve:
B'(的 T 的)= 2( T 的 - 1)P 0 + 2(1 - 2 T 我>)P 1 + 2 T P
和此是平行来自摄像机的矢量(在原点)到曲线如果
and this is parallel with the vector from the camera (at the origin) to the curve if
B( T 的)×B'(的 T 的)= 0
解决本作的 T 的,你就会有曲线在地平线上的点。你怎么可以扩展这个地平线整个表面取决于你的表面构造。 (也许你可以找到地平线点的曲线在表面的每一端,并加入他们用一条直线?)
Solve this for t and you'll have the point on the curve at the horizon. How you can extend this to the horizon for the whole surface depends on how your surface is constructed. (Maybe you can just find the horizon points for the curves at each end of the surface and join them with a straight line?)
这篇关于计算曲面的视野? - 不极值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!