Interpolation, Lines(插值、线性插值)
admin
2023-02-11 07:40:04
0

周一到周五,每天一篇,北京时间早上7点准时更新~

Interpolation is a term used to describe the process of finding values that lie between a set of known points(插值的意思是从一群已知的点的集合中找出某一个值的过程). Consider the equation of the line passing through points A and B(想象一下一个连接A点到B点的直线):
Interpolation, Lines(插值、线性插值)
where P is any point on the line and is the vector from A to B(这里P表示的时候AB之间任意一点):

Interpolation, Lines(插值、线性插值)
We can therefore write this equation as(因此我们可以把这个等式写成:)
Interpolation, Lines(插值、线性插值)
It is easy to see that when t is 0, P is equal to A; and when t is 1, P is equal to A + B − A, which is simply B. Such a line is shown in Figure 4.13(当t是0的时候,p就相当于A点,当t的值是1的时候,p就相当于B点,如图4.13所示)

Interpolation, Lines(插值、线性插值)
If t lies between 0.0 and 1.0, then P will end up somewhere between A and B(如果t的值在0到1之间,那么p就落在A与B之间的某处). Values of t outside this range will push P off the ends of the line. You should be able to see that by smoothly varying t, we can move point P from A to B and back. This is known as linear interpolation(如果t的值超出了这个范围,那么p则也会超出AB的范围。可以看到,当让t从0到1慢慢变化时,p会从A移动到B,这叫线性插值). The values of A and B (and therefore P) can have any number of dimensions(A和B的值可以有任意多个维度). For example, they could be scalar values; two-dimensional values such as points on a graph; three-dimensional values such as coordinates in 3D space, colors, and so on(比如这里A和B的值可以是一个标量,可以是二维的点,可以是三位的点、颜色等等); or even higher-dimension quantities such as matrices, arrays, or even whole images(甚至是更高维度的的矩阵、数组亦或是整个图像). In many cases, linear interpolation doesn’t make much sense (for example, linearly interpolating between two matrices generally doesn’t produce a meaningful result), but angles, positions, and other coordinates can normally be interpolated safely(在很多情况下,线性插值不怎么好使,但是在角度、位置以及其他坐标方面,一般来说这就够了). Linear interpolation is such a common operation in graphics that GLSL includes a builtin function specifically for this purpose, mix:(在GLSL里,能用来进行线性插值的内置函数是mix)

vec4 mix(vec4 A, vec4 B, float t);
The mix function comes in several versions taking different dimensionalities of vectors or scalars as the A and B inputs and taking scalars or matching vectors for t(该函数接收A、B两个数据,然后变量t,来对数据进行线性插值).

本日的翻译就到这里,明天见,拜拜~~

第一时间获取最新桥段,请关注东汉书院以及图形之心公众号

东汉书院,等你来玩哦

上一篇:Curves(曲线)

下一篇:关于手游的开发

相关内容

热门资讯

终于了解“旺旺福建麻将.真的有... 终于了解“旺旺福建麻将.真的有挂吗?”外卦神器下载您好,旺旺福建麻将这个游戏其实有挂的,确实是有挂的...
南博父子局:揭秘文物圈最隐秘“... 南京博物院最近很忙。忙着被告上法庭(庞家后人追索捐赠文物),忙着回应举报(退休员工指控前院长盗卖国宝...
今日重大通报“麻友圈2.怎么开... 今日重大通报“麻友圈2.怎么开挂?”其实是有挂您好,麻友圈2这个游戏其实有挂的,确实是有挂的,需要了...
玩家最新攻略“新三哥玩十三张.... 网上科普关于“新三哥玩十三张有没有挂”话题很是火热,小编也是针对新三哥玩十三张作*弊开挂的方法以及开...
终于明白“功夫熊猫炸金花.到底... 终于明白“功夫熊猫炸金花.到底有挂吗?”必胜开挂神器您好,功夫熊猫炸金花这个游戏其实有挂的,确实是有...
终于了解“新玉海楼茶苑.到底有... 家人们!今天小编来为大家解答新玉海楼茶苑透视挂怎么安装这个问题咨询软件客服徽4282891的挂在哪里...
中植企业集团有限公司原董事局主... 2025年12月23日,北京市第一中级人民法院对北京市人民检察院第一分院首批提起公诉的中植系管理人员...
从“智驾平权”到L3准入 智驾... [ 近日,车百会的数据也显示,2026年,在L2辅助驾驶渗透率进一步提升至70%的同时,L3及以上自...
今日重磅消息“中至南昌麻将.可... 您好:中至南昌麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9752949】很多玩家在这款...
终于了解“麦穗app推筒子.开... 有 亲,根据资深记者爆料麦穗app推筒子是可以开挂的,确实有挂(咨询软件...