需要在 o3d 中缩放方面的帮助

发布于 2024-08-02 03:35:08 字数 53 浏览 1 评论 0原文

我一直很难找到很多关于 o3d 的文档(这并不奇怪)。 有谁知道如何在o3d中缩放我的x?

I have been having trouble find much documentation on o3d (not too surprisingly). Does anyone know how to scale my x in o3d?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

潦草背影 2024-08-09 03:35:08

在 o3djs.math 模块中有一个函数:

o3djs.math.matrix4.scaling = function(v) ...

其中“v”是一个向量。 因此,如果您有当前的变换矩阵,您可以执行以下操作:

var scaleMatrix = o3djs.math.matrix4.scaling( [0.6, 1, 1] );
var newMatrix = o3djs.math.mulMatrixMatrix4(scaleMatrix, currMatrix);

“newMatrix”会将立方体的 X 维度缩放 0.6,然后应用“currMatrix”。

In the o3djs.math module there is a function:

o3djs.math.matrix4.scaling = function(v) ...

where "v" is a vector. So if you have a current transformation matrix you could do:

var scaleMatrix = o3djs.math.matrix4.scaling( [0.6, 1, 1] );
var newMatrix = o3djs.math.mulMatrixMatrix4(scaleMatrix, currMatrix);

The "newMatrix" would scale the X dimension of the cube by 0.6 and then apply "currMatrix" after that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文