[Figure] players

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.