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

标签 java opengl lwjgl

我正在尝试使用这些变量计算相机向上 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/

相关文章:

java - 为什么javafx中main方法的类应该是public的?

java - 使用 Zip4j : Probably not a zip file or a corrupted zip file 在 Android 中创建 zipFile 时出现异常

java - 渲染非立方体沙盒游戏的最佳方式?

java - GLSL 着色器 : Interpolate between more than two textures

Java-Slick2D/lwjgl 获取鼠标位置

java - Spring状态机在uml中定义选择状态

java - 如何使用 java 在 elasticsearch 中进行 AND 多个 setQuery?

c# - 是否可以在 OpenGL 中从多个 Texture2D 对象创建一个 Texture2D_Array?

opengl - 如何创建自己的 openGL 上下文并将其绑定(bind)到 GLCanvas?

java - Eclipse 无法加载 liblwjgl64.so