hi, i'm trying to do the camera to function like this website does.
http://ecodazoo.com/

here's my code but it doesn't work well.

//------------------------------------------------------------------------------------//
//Away3D Loop
function Away3DLoop(event:Event):void
{
  //Allow Mouse To Zoom And Rotate
  if (_rotCamera)
  {
     if (_firstClick == true)
     {
         _firstClick = false;
         _lastMouseX = view3D.mouseX;
         _lastMouseY = view3D.mouseY;
     }
     _dragX = (view3D.mouseX - _lastMouseX);
     _dragY = (view3D.mouseY - _lastMouseY);
     _lastMouseX = view3D.mouseX;
     _lastMouseY = view3D.mouseY;
     hoverCamera3D.targetpanangle += _dragX;
     hoverCamera3D.targettiltangle += _dragY;

     //This will work for the rotation around the object at 0,0,0
     hoverCamera3D.hover();

     //if i add this two lines below and take away the hover();
function it will allow to move up and down
     //hoverCamera3D.target.y+=_dragY;
     //hoverCamera3D.y+=_dragY;

     //but if i put the ".target.y", ".y", and ".hover" all together,
it will work really weird.
  }

  // rerender viewport on each frame
    view3D.render();
}

//------------------------------------------------------------------------------------//

any help would be a great deal.

thanks in advance.

Reply via email to