Physics Based Animation Effects Week#11

Past week, I’ve mainly cleaned up some bugs in physics animations and added new options only available in xml that control starting velocity, bounciness, and density of the box2d body.

There are two velocity options velocity-x and velocity-y that control x and y starting velocity respectively for the box2d body.
Bounciness option takes values between [0,1]. 1 meaning no energy loss on collisions and has a default value of 0.1.
Density option specifies the box2d body density in kg/m².

All of the new xml options are imported/exported in the LO extension (loext) namespace.

Hopefully, these new xml options will make it possible to craft better & more exciting physics animation presets.

I’ve tried to come up with some animation effect presets which illustrate what’s possible that mix in these new options.
One animation effect each for entrance, emphasis and exit.

Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.

YouTube privacy policy

If you accept this notice, your choice will be saved and the page will refresh.

Here’s the odp file and content.xml excerpt which only contain the animation hierarchies if you’re interested in giving a look:

<!-- emphasis example -->
<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      <anim:par smil:begin="0s">
	<anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click" presentation:preset-class="emphasis" presentation:preset-id="tumble-and-linear-glide">
	  <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id1" loext:velocity-x="10000" loext:bounciness="0.9"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id1" smil:attributeName="x" smil:to="(x)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id1" smil:attributeName="y" smil:to="(y)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id1" smil:attributeName="rotate" smil:to="0"/>
	</anim:par>
      </anim:par>
    </anim:par>
  </anim:seq>
</anim:par>

<!-- entrance example -->
<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      <anim:par smil:begin="0s">
	<anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click" presentation:preset-class="entrance" presentation:preset-id="shoot-in-from-top-left">
	  <anim:seq>
	    <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="visibility" smil:to="visible"/>
	    <anim:animate smil:dur="0.001s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="x" smil:to="width*.5"/>
	    <anim:animate smil:dur="0.001s" smil:fill="hold" smil:targetElement="id2" smil:attributeName="y" smil:to="height*.5"/>
	    <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id2" loext:velocity-x="10000" loext:velocity-y="10000" loext:bounciness="0.6"/>
	  </anim:seq>
	  <anim:transitionFilter smil:dur="1s" smil:targetElement="id2" smil:type="fade" smil:subtype="crossfade"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id2" smil:attributeName="x" smil:to="(x)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id2" smil:attributeName="y" smil:to="(y)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id2" smil:attributeName="rotate" smil:to="0"/>
	</anim:par>
      </anim:par>
    </anim:par>
  </anim:seq>
</anim:par>

<!-- exit example -->
<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      <anim:par smil:begin="0s">
	<anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click" presentation:preset-class="exit" presentation:preset-id="tumble-and-disappear">
	  <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id3" loext:bounciness="0.8"/>
	  <anim:transitionFilter smil:begin="3s" smil:dur="1s" smil:targetElement="id3" smil:type="fade" smil:subtype="crossfade" smil:mode="out"/>
	  <anim:set smil:begin="4s" smil:dur="0.001s" smil:fill="hold" smil:targetElement="id3" smil:attributeName="visibility" smil:to="hidden"/>
	</anim:par>
      </anim:par>
    </anim:par>
  </anim:seq>
</anim:par>

<!-- emphasis example in a fuller slide -->
<anim:par presentation:node-type="timing-root">
  <anim:seq presentation:node-type="main-sequence">
    <anim:par smil:begin="next">
      <anim:par smil:begin="0s">
	<anim:par smil:begin="0s" smil:fill="hold" presentation:node-type="on-click" presentation:preset-class="emphasis" presentation:preset-id="tumble-and-linear-glide">
	  <loext:animatePhysics smil:dur="4s" smil:fill="hold" smil:targetElement="id4" loext:velocity-x="10000" loext:bounciness="0.7"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id4" smil:attributeName="x" smil:to="(x)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id4" smil:attributeName="y" smil:to="(y)"/>
	  <anim:animate smil:begin="4s" smil:dur="2s" smil:fill="hold" smil:decelerate="0.5" smil:targetElement="id4" smil:attributeName="rotate" smil:to="0"/>
	</anim:par>
      </anim:par>
    </anim:par>
  </anim:seq>
</anim:par>