我在这个plunkr中有一个 GL 立方体,看起来像这样:
我想从一个枢轴缩放、旋转和平移立方体。希望让它像https://www.youtube.com/watch?v=sZeBm8EM3mw&feature=youtu.be
对于这个转换,我将使用:
gl-matrix。幸运的是,这种转换在下面有一个方法mat4.fromRotationTranslationScale()
问题是我仅仅使用这种方法就玩得很开心?没有错误,只是默认实现从屏幕上删除了多维数据集。
mat4.fromRotationTranslationScale(
matrix,
quat.create(),
vec3.create(),
vec3.create()
);
(静止的)
fromRotationTranslationScale(out, q, v, s) → {mat4}
从四元数旋转、矢量平移和矢量比例创建矩阵。
Parameters:
Name Type Description
out mat4 mat4 receiving operation result
q quat4 Rotation quaternion
v vec3 Translation vector
s vec3 Scaling vector
问题:
我使用fromRotationTranslationScale
不正确吗?如果是这样,我哪里错了。如果没有,如何获得某种反馈来玩弄。
我的数学很弱,但我觉得我可以在你的帮助下进行逆向工程和学习;)。