本文介绍了围绕给定的轴和角度的旋转点正确旋转对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Three.js中,似乎有很多旋转方式,我个人并不觉得这很直观.参见例如例子

In Three.js there seems to be quite a few ways of rotation which i personally do not find very intuitive. See e.g. the example

将旋转应用于多个对象时,会得到非常奇怪的意外效果.例如.当我旋转已添加到彼此的对象并开始旋转父对象时,各个对象之间的相对位置会突然变得突然变大,而原来放置的位置不同.我现在正在尝试分组,并希望避免相同的效果.

I get very strange unexpected effects when I apply rotation to multiple objects. E.g. when I rotate objects that have been added to each other and start rotating the parent the individual objects will all over sudden by placed differently in respect to each other then they originally where. I am now experimenting with grouping and would like to avoid the same effect.

请参见 http://pi-q -robot.bitplan.com/example/robot?robot=/models/thing3088064.json 了解当前的事务状态,并 https://github.com/BITPlan/PI-Q-Robot 作为源代码.

See http://pi-q-robot.bitplan.com/example/robot?robot=/models/thing3088064.json for the current state of affairs and https://github.com/BITPlan/PI-Q-Robot for the source code.

因此,我根据不同的API选项搜索了适当的示例:

So i searched for proper examples following the different API options:

旋转

function renderScene() {
    stats.update();
    //side1.rotation.z += 0.02;
    pivot.rotation.z += 0.02;

09-06 05:33