camera.lookAt()在THREE.js中是否仍然存在?

huangapple go评论83阅读模式
英文:

Does camera.lookAt() still exist in THREE.js?

问题

我正在浏览关于如何设置相机的帖子,其中许多提到了 lookAt 函数。当我去查阅 THREE.js 文档时,我找不到这个方法。它去哪了?在 lookAt 函数的位置上,我应该做什么?

我只找到了针对 Object3DlookAt 方法:https://threejs.org/docs/#api/en/core/Object3D.lookAt,但这并不符合需求。

英文:

I was browsing posts about how to set up the camera and many of them mentioned the lookAt function. When I go to THREE.js documentation I can't find the method. Where did it go? What should I do in place of the lookAt function?

I only found a lookAt method for Object3D: https://threejs.org/docs/#api/en/core/Object3D.lookAt, which does not satisfy the purpose.

答案1

得分: 0

Camera继承自Object3D。因此,它继承了所有它的方法。

而且,透视相机(PerspectiveCamera)和正交相机(OrthographicCamera)也是如此,它们从基本Camera类继承。

英文:

Camera inherits from Object3D. So it inherits all its methods.

And so it does the PerspectiveCamera and OrthographicCamera as well, inheriting from the base Camera class

camera.lookAt()在THREE.js中是否仍然存在?

huangapple
  • 本文由 发表于 2023年7月14日 09:45:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76684226.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定