Hi there,
I have a simple scene which comprises an imported room interior in OBJ format, and listeners on the stage so that when the mousebutton is held down, you can look around with the camera.
you can see it here:
http://www.margaretscratcher.co.uk/virtemp/index2.html
(there is no preloader, but the assets are only 2.5mb)
What I’m finding isthat once it;s loaded, if you look to the right, initially there is a bad jerkiness, but once you;ve panned across it disappears, and then does not return.
It seems as if as each part of the imported OBJ comes into view, there is a brief performance issue, is there any way to avoid this?
Also am I going about the camera mouselook the right way ie, should the tween be in onEnterFrame?
private function vpMouseDown (event:MouseEvent)
{
//camMove = true
//stage.quality = "low";
MouseLook = true;
//viewport.filters = [blur];
prevmouseposx = mouseX;
trace ("MouseX = "+ mouseX)
prevmouseposy = mouseY;
trace ("MouseY = "+ mouseY)
newCamRotX = camera.rotationX
newCamRotY = camera.rotationY
//Tweener.addTween(camera, { rotationX:camRot, time:.5, onComplete: null } );
}
private function vpMouseUp (event:MouseEvent)
{
noMouseLook();
}
private function noMouseLook():void
{
//blur.blurX = 0
// blur.blurY = 0
MouseLook = false;
//viewport.filters = null;
}
private function onEnterFrame(ev : Event) : void
{
differenceX = mouseX - prevmouseposx;
differenceY = mouseY - prevmouseposy;
//click mouselook
if (MouseLook)
{
newCamRotX -= (differenceY/6)
newCamRotY += (differenceX/2)
//cameratween
Tweener.addTween(camera, {rotationY: newCamRotY, rotationX: newCamRotX, time:.5, transition:liftEase});
//cameratween to here
prevmouseposx = mouseX;
prevmouseposy = mouseY;
}
view.render();
}