Using AlloyTouch to control three.js 3D model

Using AlloyTouch to control three.js 3D model_第1张图片

As you can see, the above cube rotation, acceleration, deceleration stop all through the AlloyTouch to achieve.

Demo(Mobile)

Using AlloyTouch to control three.js 3D model_第2张图片

Code




factor need to continue to debug the best value for the speed and time of inertial motion let go after the best effect.
moveFactor need to continue to debug the best value, is to let the lateral drag distance map to achieve the rotation angle.

If you don't need an inertial motion. For example, the king of glory in the task rotation is not inertia, the finger left the screen will immediately stop moving. Such as:

Using AlloyTouch to control three.js 3D model_第3张图片

You only need to set the AlloyTouch inertia to false.

Non inertia demo

Using AlloyTouch to control three.js 3D model_第4张图片

Code



AlloyTouch

Github:https://github.com/AlloyTeam/AlloyTouch
Any question, please let me know:https://github.com/AlloyTeam/AlloyTouch/issues

你可能感兴趣的:(Using AlloyTouch to control three.js 3D model)