codecamp

three.js LinearInterpolant

代码示例

const interpolant = new THREE.LinearInterpolant(
new Float32Array( 2 ),
new Float32Array( 2 ),
1,
new Float32Array( 1 )
);

interpolant.evaluate( 0.5 );

构造函数(Constructor)

LinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer )

parameterPositions -- 位置数组
sampleValues -- 样本数组
sampleSize -- 样本数量
resultBuffer -- 用于存储插值结果的缓冲区。

属性(Properties)

.parameterPositions : null

.resultBuffer : null

.sampleValues : null

.settings : Object

.valueSize : null

方法(Methods)

.evaluate ( t : Number ) : Array

评估位置t处的插值。

源码(Source)

src/math/interpolants/LinearInterpolant.js


three.js DiscreteInterpolant
three.js QuaternionLinearInterpolant
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

参考

核心 / BufferAttributes

渲染器 / WebXR

开发者参考

WebGL渲染器

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }