# 3D rotation around center instead of 0,0

**URL:** <https://forum.kirupa.com/t/3d-rotation-around-center-instead-of-0-0/307800>\
**Category:** flash\
**Created:** [April 10, 2010, 4:50pm UTC](https://forum.kirupa.com/t/3d-rotation-around-center-instead-of-0-0/307800 "2010-04-10T16:50:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayrich86](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jayrich86](https://forum.kirupa.com/u/jayrich86)\
**Post date:** [April 10, 2010, 4:50pm UTC](https://forum.kirupa.com/t/3d-rotation-around-center-instead-of-0-0/307800/1 "2010-04-10T16:50:02Z")

</div>

I’ve created this demo:

[http://www.mav-media.com/clients/SPN/](http://www.mav-media.com/clients/SPN/)

as you can see the content rotates around the center

now I’m trying to rotate this the same way:

[http://www.mav-media.com/clients/SPN/bin/](http://www.mav-media.com/clients/SPN/bin/)

Clearly the view is registered at 0,0. How do I rotate around the center instead? Here is the code I am using:

```auto
        private function loop(e:Event):void {
            
            var distx:Number = mouseX / 1000;
            
            var disty:Number = mouseY / 600;
            
            trace(view.x);
            
            TweenLite.to(view, 1.5, {rotationY: (-6.5+(13*distx)), rotationX: (6.5-(13*disty)), ease:Expo.easeOut});
            
        }

```

Any help with this would be greatly appreciated.

Thank you,
