Strange jerk/performance issue…

Software: Away3D 4.x

Mr Margaret Scratcher, Sr. Member
Posted: 14 July 2011 04:28 AM   Total Posts: 344

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{rotationYnewCamRotYrotationXnewCamRotXtime:.5transition:liftEase});
        
//cameratween to here

    
prevmouseposx mouseX;
    
prevmouseposy mouseY;
    
    
}
   
   view
.render();
  
   

John Brookes, Moderator
Posted: 14 July 2011 05:13 PM   Total Posts: 732   [ # 1 ]

Mabye try adding everything into the cameras view so its updated/added do a single render, then move the objects into position.

Or rotate cam once to get everything updated/added and hide the 3d stuff with stage 2d info prescreen thang while that happens.

You don’t need tweener for this just do you own ease, look at the HoverDragController for how.

   

Mr Margaret Scratcher, Sr. Member
Posted: 15 July 2011 01:28 AM   Total Posts: 344   [ # 2 ]

So it’s some sort of caching issue then?

As for using the Tweener to ease the camera about, I don’t mind that, it was more wondering whether having the tween in the enter fame function would cause performance issues, but yes, I might look at the hoverdrag controller and modify it for what I want to use it for.

Thanks!

   

Mr Margaret Scratcher, Sr. Member
Posted: 15 July 2011 04:44 PM   Total Posts: 344   [ # 3 ]

Okay so I made my cameraController a seperate .as, which is something I’ve never done before, so quite pleased with that.

But I have found a downside to using this kind of way of easing:

onenterframe
{
_camera
.rotationY =_camera.rotationY + (_targetYRot _camera.rotationY) * _dragSmoothing

wheareas with the tweener, you specify a time for the tween, so a drop in framerate does not affect the time it takes to ease to the target postition, unlike the above method.


Something else for me to figure out I guess..

   

Mr Margaret Scratcher, Sr. Member
Posted: 10 August 2011 10:30 PM   Total Posts: 344   [ # 4 ]

Yeah it’s definitely using the hardware, generally runs really smooth, it#s just as an object first moves into view that there is a slight pause..

   

3dNewb, Sr. Member
Posted: 06 April 2012 01:41 PM   Total Posts: 105   [ # 5 ]

Did you manage to solve this? I’m am having the same “jerky” behaviour issue as you have: the first time an item enteres the camera-view it skips a couple of frame…

   
   
‹‹ Context3D Error

X

Away3D Forum

Member Login

Username

Password

Remember_me



X