1 Reply Latest reply: Nov 18, 2011 12:55 PM by pio_tra123 RSS

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

    Philipp Fischer



      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.