Problem with Camera movement and Hovercontrol : how can a move the camera to a specific panAngle and tiltAngle? 

Software: Away3D 4.x

aeki, Member
Posted: 11 November 2012 05:25 PM   Total Posts: 73

Hi there,

I’ve got a question regarding the camera control on away4.x.

When clicking on an specific object (whiwhs stands for a button), I would like the camera to smoothly hover to a defined panAngle and tiltAngle.

I combined the camera with a hovercontroller, I thought that setting the panAngle and tiltAngle to specific values would do the trick but nothing is happening. What I am doing wrong or is there something I do not understand right ?

Here is an extract of my code :

// Setup Camera
   
camera3D = new Camera3D(new PerspectiveLens(25));
   
camera3D.lens.far _CAMERA_VIEW_DISTANCE;  

   
cameraController = new HoverController(camera3D,null,185,7,1000,0,90,0,360,8,2,true);

  private function 
onMeshMouseDown(event:MouseEvent3D):void
  {   
   cameraController
.tiltAngle);
   if (
event.object.name == 'MyObject'){
    this
.cameraController.panAngle 180;
    
this.cameraController.tiltAngle 0;
    
// Nothing moves.....

   
}

  } 

 

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 11 November 2012 05:34 PM   Total Posts: 166   [ # 1 ]

I had ran in to same problem.
Try next code.

this.cameraController.panAngle 180;
this.cameraController.tiltAngle 0;
this.cameraController.update(); 

 

   

aeki, Member
Posted: 11 November 2012 05:58 PM   Total Posts: 73   [ # 2 ]

Thanks for your help, but i’va already tried and it doesn’t work…

   

John Wilson, Member
Posted: 11 November 2012 07:05 PM   Total Posts: 62   [ # 3 ]

I suppose you are adding an enter frame listener before setting the pan and tilt angles:

this.addEventListener(Event.ENTER_FRAMEonEnterFrame); 

private function 
onEnterFrame(event:Event):void

 view
.render();


I

 

   

aeki, Member
Posted: 11 November 2012 07:28 PM   Total Posts: 73   [ # 4 ]

Yes sure, but i realized that my onEnterFrame method was overriding the panAngle and tiltAngle properties !!!!

Thanks for helping!!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X