0 Replies Latest reply on Nov 20, 2013 1:11 AM by amit12121989

    Camera Event Handler

    amit12121989

      I handled camera event on changing of views from view list.

      I wrote following js code on 3D annotation----

       

      var collectViews = new CameraEventHandler();

      collectViews.onEvent = function(event)

      {

      console.println("view changed");

        var camera = scene.cameras.getByIndex(0);

        camera.transform.rotateAboutXInPlace( -90 * Math.PI / 180);

        camera.targetPosition.set(scene.computeBoundingBox().center)

       

      }

      runtime.addEventHandler(collectViews);

       

       

       

       

       

       

      But when i changed view from viewlist of 3D tool bar then camera event function get called 2 times......

       

       

      please solve this problem.............?

       

       

      Why it is calling two times on changing of view ?