Papervision3d + ScreenSaver

So I have been creating a screensaver is flash and papervision3d. I’ve got it working except for the rotation. Right now it’s all over the place. I’ve never been good at the math in terms of actionscript, so I was wondering if anyone had any suggestions on how I could make this layout bounce around the screen in a more controlled and legible way, like a screensaver should. Below is the code and I have attached the swf of what it currently looks like. Thanks in advance.

package {
    import flash.display.Bitmap;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import org.papervision3d.scenes.*;
    import org.papervision3d.cameras.*;
    import org.papervision3d.objects.*;
    import org.papervision3d.materials.*;
    import caurina.transitions.Tweener;
    import lt.uza.utils.*;
    import Calendar;
    import GreenInitiative;
    import GreenTip;
    import Layout;
    public class HGScreenSaver extends MovieClip{
        var global:Global = Global.getInstance();
        var scene:InteractiveScene3D;
        var camera:Camera3D;
        var container:MovieClip;
        var p:Plane;
        public function HGScreenSaver(){            
            trace("HGScreenSaver Initialized");
        public function init(){
            var layoutDummy:Layout = new Layout();
            container = new MovieClip();
            container.x = stage.stageWidth * 0.5;
            container.y = stage.stageHeight * 0.5;
            scene = new InteractiveScene3D(container);
            camera = new Camera3D();
            camera.zoom = 11;
            var layout:MovieAssetMaterial = new MovieAssetMaterial("Layout", true);
            layout.oneSide = false;
            layout.animated = true;
            p = new Plane(layout, layoutDummy.width, layoutDummy.height, 0, 0)
        public function rotateSS(event:Event){
            var screen:DisplayObject3D = scene.getChildByName("p");
            var rotateX:Number = -(Math.floor(Math.random() * stage.stageWidth))
            var rotateY:Number = -(Math.floor(Math.random() * stage.stageHeight))
            screen.rotationX += (rotateX - screen.rotationX) / 12;
            screen.rotationY += (rotateY - screen.rotationY) / 12;
        public function loadXML(){
            var xml:XML;
            var url:String = "xml/screensaver.xml";
            var request:URLRequest = new URLRequest(url);
            var loader:URLLoader = new URLLoader(request);
            loader.addEventListener("complete", urlLoaded);
            function urlLoaded(event:Event):void{
                xml = new XML(;
                trace("xml loaded");
                global.tip = xml.tip[0];
                global.initiative = xml.initiative[0];
                addEventListener(Event.ENTER_FRAME, rotateSS);