Skip navigation
Philipp Fischer
Currently Being Moderated

Animating camera position and SceneCamera.setDirty(...)

Oct 16, 2011 9:10 PM

Tags: #camera #animation #proscenium #dirtyflag

Hi,

 

I would like to animate the position of the active camera using a property-based animation manager. My animation manager (similar to Tweener) interpolates properties of any given AS objects over time. I would want to use it for the camera. Then it would need to set/get a "z" property of a given camera object, e.g.:

 

sg.scene.activeCamera.position.z = targetValue;

(targetValue would get changed by animation manager over period of 3 seconds)

 

Setting the z position with the call did not have any effect on screen in my case. My guess is that there is somedirty flag that needs to be set whenever properties get changed. I found sg.scene.activeCamera.setDirty(…) but its not that clear which parameter format it would take.

 

I am also not sure, if SceneCamera.position is the right property to manipulate - I tried some other calls:

 

sg.scene.activeCamera.position.z = targetValue;

sg.scene.activeCamera.cameraTransform.position.z = targetValue

sg.scene.activeCamera.transform.position.z = targetValue;

sg.scene.activeCamera.modelTransform.position.z = targetValue;

 

I cannot rely on the methods SceneCamera.setPosition() nor SceneCamera.lookat() - they would not work with the property-based animation manager.

 

Any short comment or documentation would be greatly appreciated.

 

Thanks,

Philipp


 
Replies
  • Currently Being Moderated
    Nov 18, 2011 12:55 PM   in reply to Philipp Fischer

    I know this is not an ansfer but maybe workaround with getter and setter coud do this?

     

    something like this:

     

    public function set cameraX(newX):void

    {

              SceneCamera.setPosition(newX, cameraY, cameraZ );

    }

    public function get cameraX() { return SceneCamera.position.x; }

     

     

    and the same for Y and Z ...

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points