副法线的来由(binormal)

 Any given vertex has a tangent space as defined in Figure 12.4. The normal of the
vertex that you’re already familiar with points out from the triangle. The tangent and
the binormal, on the other hand, are new concepts. The tangent and the binormal
both lie on the plane of the triangle(这句话比较重要,切线和副法线都在三角形平面上).
The triangle is also UV mapped to the texture
(be it a diffuse map or a normal map). So what the tangent space actually describes
is a form of 3D texture space(切线空间其实一种3D纹理空间)(这里也可以说是一个模型内部零件的空间).

副法线的来由(binormal) - 995116752 - 秋风扫落叶的博客

 

Here’s some semi-useless knowledge for you. It is actually incorrect to talk
about binormals in this context. The mathematically correct term is actually
bitangent!(在数学中正确的叫法是副切线)
However, people have been using the term binormal since no one knows
when(然而人们一直用副法线这种术语,因为没人知道当....这后面应该有话).
This is loosely because there can be only one normal per surface, but there can
be infinite amount of tangents on the surface(这里这么宽松是因为一个平面只有一条法线,而可以有无数条切线).
The term “bi” means two or “second
one,” which is why it is incorrect to be talking about a second normal in this case("bi"表示两个或第二个).
You can read more about this (and other interesting things) at Tom Forsyth’s
blog:
http://home.comcast.net/~tom_forsyth/blog.wiki.html

 

//下面是GPU精粹中在波中给出的三个线的数学来源,在公式里你可以有感性的认识

副法线的来由(binormal) - 995116752 - 秋风扫落叶的博客

 

总而言之,副法线和切线都是平面的切线,这两条切线是对不同轴求导的结果,只是为了构成一个局部的切线空间而已。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以帮您用Plotly画一张这样的图。以下是示例代码: ```python import plotly.graph_objects as go import numpy as np # 生成曲线上的点 t = np.linspace(0, 2 * np.pi, 1000) x = np.sin(t) y = np.cos(t) z = t # 计算切向量、主法向量和法向量 dx_dt = np.cos(t) dy_dt = -np.sin(t) dz_dt = np.ones_like(t) dr_dt = np.array([dx_dt, dy_dt, dz_dt]) dr_dt_norm = np.linalg.norm(dr_dt, axis=0) tangent_vector = dr_dt / dr_dt_norm d2x_dt2 = -np.sin(t) d2y_dt2 = -np.cos(t) d2z_dt2 = np.zeros_like(t) d2r_dt2 = np.array([d2x_dt2, d2y_dt2, d2z_dt2]) d2r_dt2_norm = np.linalg.norm(d2r_dt2, axis=0) normal_vector = d2r_dt2 / d2r_dt2_norm binormal_vector = np.cross(tangent_vector, normal_vector) # 绘制曲线和向量 fig = go.Figure() fig.add_trace(go.Scatter3d( x=x, y=y, z=z, mode='lines', name='Curve', )) point_of_interest = 500 # 选取曲线上的一个点 fig.add_trace(go.Scatter3d( x=[x[point_of_interest]], y=[y[point_of_interest]], z=[z[point_of_interest]], mode='markers', name='Point of Interest', )) # 在该点处绘制切向量、主法向量和法向量 vector_scale = 0.25 # 向量缩放比例 vector_color = ['red', 'green', 'blue'] # 向量颜色 for vector, color, name in zip([tangent_vector[:, point_of_interest], normal_vector[:, point_of_interest], binormal_vector[:, point_of_interest]], vector_color, ['Tangent Vector', 'Normal Vector', 'Binormal Vector']): fig.add_trace(go.Cone( x=[x[point_of_interest]], y=[y[point_of_interest]], z=[z[point_of_interest]], u=[vector[0] * vector_scale], v=[vector[1] * vector_scale], w=[vector[2] * vector_scale], sizemode='absolute', sizeref=0.1, anchor='tail', showscale=False, colorscale=[[0, color], [1, color]], name=name, )) fig.update_layout( scene=dict( xaxis=dict(title='X'), yaxis=dict(title='Y'), zaxis=dict(title='Z'), aspectratio=dict(x=1, y=1, z=0.3), camera=dict( eye=dict(x=-1.7, y=-1.7, z=0.5), up=dict(x=0, y=0, z=1), ), ), margin=dict(l=0, r=0, t=0, b=0), ) fig.show() ``` 这个代码会生成一个空间曲线,以及在曲线上的某个点处标注出其切向量、主法向量和法向量。您可以根据需要修改点的位置、曲线的形状等参数。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值