嗨,stackoverflow 天才们。我正在将三个 js 网格位置转换为 html5 Canvas 位置。我能够将 vector3 位置转换为 Canvas 位置。我的问题是将网格旋转转换为 Canvas 旋转。
我所做的是:
ctx.rotate(rotation._y);
ctx.rect( 0, 0, width,height);
但是它不起作用。正确的做法是什么?
谢谢
编辑:
I think the rotation for mesh object starts at center point so what I did is to tranlate first to the center point then do a rotate which works.
this.context.translate( cx, cy );
this.context.rotate(item.rotation._y);
最佳答案
如果您想使用 3d 场景图渲染 Dom 内容,请使用 THREE.CSSRenderer。
关于javascript - 将 THREE.js 对象旋转转换为 Canvas 旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60359299/