【问题标题】:threejs makePerspective method has been removed or changedthreejs makePerspective 方法已被删除或更改
【发布时间】:2013-08-06 06:16:09
【问题描述】:

在旧版本的threejs中,您可以这样做:

camera.projectionMatrix = THREE.Matrix4.makePerspective( fov, aspect, 1, 1100 );

现在抛出一个错误:

has no method 'makePerspective' 

这被什么取代了,我怎么称呼它?

文档中还是说明了这个方法存在,我在THREE.Matrix4.prototype.makePerspective找到了,但是我在那里调用就不行了。

【问题讨论】:

  • “它不起作用”是什么意思?你怎么称呼它?

标签: javascript 3d three.js webgl


【解决方案1】:

您正试图调用一个原型方法,如静态方法。它需要在 Matrix4 实例上调用。你可以试试:

camera.projectionMatrix = (new THREE.Matrix4()).makePerspective( fov, aspect, 1, 1100 );

【讨论】:

    猜你喜欢
    • 2018-10-17
    • 2013-10-02
    • 1970-01-01
    • 1970-01-01
    • 2013-09-07
    • 1970-01-01
    • 1970-01-01
    • 2019-06-25
    • 1970-01-01
    相关资源
    最近更新 更多