简体   繁体   English

需要帮助扩展O3D

[英]Need help scaling in o3d

I have been having trouble find much documentation on o3d (not too surprisingly). 我一直很难找到有关o3d的许多文档(不足为奇)。 Does anyone know how to scale my x in o3d? 有人知道如何在o3d中缩放我的x吗?

In the o3djs.math module there is a function: 在o3djs.math模块中,有一个功能:

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

where "v" is a vector. 其中“ v”是一个向量。 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. “ newMatrix”将按比例缩放多维数据集的X尺寸0.6,然后再应用“ currMatrix”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM