计算曲面的地平线?- 不是极值 [英] Calculate the horizon of a curved face? - Not extrema

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

问题描述

我需要找到曲面的视觉水平的 2 个点.

I need to find the 2 points of the visual horizon, of a curved face.

我有:

  • 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 P0 + 2(1 - t)t P1 + t2 P2

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

对 t 进行微分得到曲线的切线:

differentiating that with respect to t gives us the tangent to the curve:

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

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天全站免登陆