计算曲面的视野? - 不极值 [英] Calculate the horizon of a curved face? - Not extrema

查看:93
本文介绍了计算曲面的视野? - 不极值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到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 2 P <子> 0 + 2(1 - T T P <子> 1 + T 2 P 2

B(t) = (1 − t)2 P0 + 2(1 − t)t P1 + t2 P2

微分,关于吨使我们有相切的曲线:

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 2

B′(t) = 2(t − 1) P0 + 2(1 − 2t) P1 + 2t P2

和此是平行来自摄像机的矢量(在原点)到曲线如果

and this is parallel with the vector from the camera (at the origin) to the curve if

B( T 的)×B'(的 T 的)= 0

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

这篇关于计算曲面的视野? - 不极值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆