Getting Started with Web Chart (7) Physical animation effects (such as tearing effects)

Source: Internet
Author: User

Physical animation

The physical animation here says that the animation effect of the graphic is similar to the physical effect in real life, such as the effect of gravity.

In fact, the realization of animation is to split an action into a continuous interval to complete, visual feeling is moving.

For example, to move a diagram from the left to the right, set the total distance of 100, every 1/40 seconds to move to 1, the effect will have.

This time interval and distance interval set how much is the best, esthetics has some definition, here does not discuss.

An example of a drag and tear window cloth

Three files

tearcloth.html; Tearcloth.css; Tearcloth.js

Tearcloth.html

<!--Add by oscar999-->
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >  
<HTML>  
<HEAD>  
<TITLE> New Document </TITLE>  
<meta name= "Author" content= "oscar999" > <link rel= "stylesheet" type= "  
Text/css "href=" tearcloth.css "  />  
</HEAD>  
      
<BODY>  
<canvas id =" C "> </ canvas>    
<center id= "info" >  
  <center id= "Top" >  
  <a id= "Close" href= "" >close</a >  
  </center>  
  <p>  
    <br>  
    -Tear The cloth with your mouse.<br><br> -Right click and drag to cut the  
    cloth<br><br>  
    -Reduce physics_accuracy if it ' s laggy.<br>& lt;br>  
  </p>  
</center>  
      
<script src= "tearcloth.js" ></script>  
</ Body>  
</HTML>

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.