Skip navigation
BriggsD787
Currently Being Moderated

Getting current view via Javascript

Apr 18, 2012 9:35 AM

In a 3D model with multiple named views, when the user selects a view from either the Views pulldown on the 3D toolbar or from the View pane under the Model Tree, the model is oriented to selected view. Is there a method in Javascript to find which named view is the currently selected view? I don't see anything in the 3D Javascript API other than getting the camera position and trying to infer which view it could be.

 

Thanks.

 
Replies
  • Currently Being Moderated
    Jul 16, 2012 10:50 AM   in reply to BriggsD787

    Selecting a view from the toolbar fires a cameraEvent in the 3D API, but there is no access to the view which triggers it. In fact there's no exposure of the 'view' object except by name, because view presets define a whole bunch of parameters beyond the scope of the JSAPI.

     

    You're correct in saying the only way you could work out which view preset was chosen would be to compare the camera matrix immediately after the cameraEvent fires to a static array of exemplars in your code - you cannot dynamically read the presets from the toolbar.

     
    |
    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