Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (x){
- //Define rotation
- var rotated = false;
- var div = document.getElementById('div'),
- // data.angle is provided by TUIO
- // data.angle - external source number with value from 0 - 7
- // assuming that 360˚ = 7 for full rotation
- // and 0˚ = 0 start of rotation
- deg = rotated ? 0 : (data.angle * 57);
- div.style.webkitTransform = 'rotate('+deg+'deg)';
- div.style.mozTransform = 'rotate('+deg+'deg)';
- div.style.msTransform = 'rotate('+deg+'deg)';
- div.style.oTransform = 'rotate('+deg+'deg)';
- div.style.transform = 'rotate('+deg+'deg)';
- rotated = !rotated;
- console.log(deg + "......." + data.angle);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement