我只是刚开始使用Three.js和图形编程。我要做的就是将摄像机从一个位置平稳过渡到另一个位置。
我发现一种解决方案利用了PathControls.js,此后已删除。
此功能应该有所帮助。需要tween.js,您可以在three.js的examples / js / libs文件夹中找到
function setupCameraPositionTween( source, target, duration, delay, easing )
{
var l_delay = ( delay !== undefined ) ? delay : 0;
var l_easing = ( easing !== undefined ) ? easing : TWEEN.Easing.Linear.None;
new TWEEN.Tween( source )
.to( target, duration )
.delay( l_delay )
.easing( l_easing )
.onUpdate ( function()
{
// copy incoming position into camera position
camera.position.copy( source );
})
.start();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句