In March, I wrote a series of articles to demonstrate the Javascript implementation (directory) of collision detection algorithm optimization through kinematics simulation. Now I am a little idle. I have slightly changed this example, place all balls in a closed space, and then rotate the mobile phone to control the ball's movement (using the HTML5 deviceapi), using Opera
In March, I wrote a series of articles to demonstrate the Javascript implementation (directory) of collision detection algorithm optimization through kinematics simulation. Now I am a little idle. I have slightly changed this example, place all balls in a closed space, and then rotate the mobile phone to control the ball's movement (using the HTML5 deviceapi), using Opera
In March, I wrote a series of articles to demonstrate the Javascript implementation (directory) of collision detection algorithm optimization through kinematics simulation. Now I am a little idle. I have slightly changed this example, place all the balls in a closed space, and then rotate the mobile phone to control the movements of the balls (using the HTML5 deviceapi) and use the SPHINX of Opera oupeng, on low-end mobile phones, 400 balls can be kept at around 40 frames.
First look at youku video demo it: http://v.youku.com/v_show/id_XNTgxOTg5NTky.html
The principle is to use the devicemotion event to obtain the acceleration of the x and y axes of the device, and then simulate the acceleration of the ball. There is a difference between devicemotion and deviceorientation. devicemotion obtains an acceleration value, measured in square seconds. deviceorientation obtains an angle. For details, see the DeviceOrientation event specification.
In this example, the online access address is (using Android devices): http://www.impony.com/tools/com.impony.balls.android/
But it is recommended to use the SPHINX simulator (http://sphinx.oupeng.com/) to access this address, or directly install the apk I packaged with the SPHINX developer platform (http://ge.oupeng.com/), high performance.
When installing the APK, you will see a lot of permission requirements, which are automatically generated during packaging. In this example, you have not accessed the privacy of the device. You can check the source code for confirmation.
APK installation package address: http://www.impony.com/tools/com.impony.balls.android/balls1.1.apk
The short addresses of the two links are: http://dwz.cn/9Lu5E and http://dwz.cn/9Lu9p
Below is:
You may be interested in the following logs
Some experiences in developing mobile applications
[Figure] chang'an Street
[Figure] the tail of February is fierce and thunderous.
[Figure] weather forecasts rain almost every day in the next three weeks
[Figure] 44.2 ℃
Original article address: [Figure] thanks to the author for sharing.