gpt4 book ai didi

java - 如何计算世界空间中的相机向上 vector

转载 作者:行者123 更新时间:2023-11-30 05:39:00 24 4
gpt4 key购买 nike

我正在尝试使用这些变量计算相机向上 vector :

private Vector3f targetPosition = new Vector3f(0, 0, 0);
private Vector3f camPosition = new Vector3f(0, 0, 0);
private float pitch = 20; // y rotation \\
private float yaw = 0; // x rotation \\

我怎样才能实现这个目标?

最佳答案

世界空间中的向上 vector 就是向上或者任何你想定义为“向上”的东西。通常 up 只是正 y:

private const Vector3f UP = new Vector3f(0.0f, 1.0f, 0.0f);

关于java - 如何计算世界空间中的相机向上 vector ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56065031/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com