Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我们的软件中,我们有一个基于鼠标移动的摄像头,其核心是四分之一。
我们想从这个位置发射射弹,我们可以这样做,但是我们想使用相机来瞄准。射弹采用一个向量,它将在每个游戏帧中添加到其位置。
我们如何从给定的相机/四元数中获取这样的向量?
四元数不代表方向,它代表旋转。您可以定义一个向量,该向量指向您的相机最初指向的方向(例如(0,0,1)),并使用四元数表示的旋转对其进行变换。
(0,0,1)