Skip navigation
Currently Being Moderated

Camera - JavaScript Access

May 25, 2012 1:43 PM

Tags: #acrobat #3d #javascript #3dpdf

This should be simple but for some reason, I can't seem to access the main camera using javascript.  Here is how I'm trying to access it:

 

var c3d = getAnnots3D(0)[0].context3D;
var camera = c3d.scene.cameras.getByID(0);

 

I've tried a bunch of camera operations (i.e. projectionType, position, roll, etc.) but it doesn't seem to be referencing the main camera, i.e. nothing changes in the view.  When I manually change the view and query the camera position using javascript it shows that it didn't change.  It just seems like I'm not accessing the camera properly.  I don't have any other cameras in the scene.  What am I doing wrong?

 
Replies
  • Currently Being Moderated
    May 25, 2012 2:51 PM   in reply to rockfed

    Use c3d.scene.cameras.getByIndex(0) to reference the default camera. If you check scene.cameras.count you'll find there are normally two, but only one is active.

     
    |
    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