gpt4 book ai didi

opengl-es - 核心 : how to rotate an object around its Y axis?

转载 作者:行者123 更新时间:2023-12-01 01:46:22 25 4
gpt4 key购买 nike

我想知道如何围绕其 Y 轴旋转对象。

例如,我想旋转 Google 示例应用程序 hello_ar_java https://github.com/google-ar/arcore-android-sdk/tree/master/samples/hello_ar_java 的 droid bot围绕其 Y 轴,角度为 alpha。

最佳答案

我最近不得不做类似的事情。在对象渲染器的 draw 方法中,您可以添加:

    Matrix.translateM(mModelMatrix, 0, x, y, z);
Matrix.rotateM(mModelMatrix, 0, rotationAngle, 0f, 1f, 0f);
Matrix.translateM(mModelMatrix, 0, -x, -y, -z);

关于opengl-es - 核心 : how to rotate an object around its Y axis?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48923898/

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