Request

Response

    Core

    Autodesk.Viewing.ViewingUtilities

    new ViewingUtilities(viewerImpl,autocam,navigation)

    Variety of utilities convenient to navigation and tool development.

    This class is instantiated internally and made available to all registered interaction tools via their “utilities” property.

    Parameters

    viewerImpl*
    object
    The viewer implementation object.
    autocam*
    object
    The Autocam interface object.
    navigation*
    object
    The Navigation interface object.
    * Required

    Methods

    activatePivot(fadeIt)

    This method activates the in scene pivot indicator. The pivot is positioned at the current camera’s pivot point.

    Parameters

    fadeIt*
    boolean
    If true the indicator will be displayed and then fade away after a short period.
    * Required

    See

    fitToView(immediate)

    Request a camera transition to fit the current model or model selection into the view frustum.

    Parameters

    immediate*
    boolean
    If true the transition will be immediate, otherwise animated over a short time period.
    * Required

    Returns

    TypeDescription
    object
    • Fit positioning information with properties “position” and “target”.

    getBoundingBox(ignoreSelection)

    Return the bounding box of the current model or model selection.

    Parameters

    ignoreSelection*
    boolean
    If true the current selection is ignored and the model bounds is returned.
    * Required

    Returns

    TypeDescription
    THREE.Box3

    getHitPoint(x,y)

    This method performs a hit test with the current model using a ray cast from the given screen coordinates.

    Parameters

    x*
    number
    The normalized screen x coordinate in [0, 1].
    y*
    number
    The normalized screen y coordinate in [0, 1].
    * Required

    Returns

    TypeDescription
    THREE.Vector3 The world space hit position or null if no object was hit.

    goHome()

    This method triggers a camera view transition to the registered home view for the current scene.

    pivotActive(state,fadeIt)

    This method changes the display state of the in scene pivot indicator. If the current scene is 2D this method has no effect.

    Parameters

    state*
    boolean
    The requested display state for the indicator.
    fadeIt*
    boolean
    If true and “state” is also true, the indicator will be displayed and then fade away after a short period.
    * Required

    See

    pivotUpdate()

    Invoke this method to refresh the pivot indicator and continue its fading action if required.

    removeTemporaryPivot()

    Restore a pivot value that was saved by a call to setTemporary Pivot.

    restorePivot(name)

    Restore the saved copy of the current pivot point and pivot set flag. Once restored the saved value is erased.

    Parameters

    name*
    string
    Optional unique name of the saved location.
    * Required

    savePivot(name)

    Save a copy of the current pivot point and pivot set flag.

    Parameters

    name*
    string
    Optional unique name of the saved location.
    * Required

    setColor()

    Change pivot color. Example, red is 0xFF0000

    setPivotColor(color,opacity)

    Change pivot color and opacity. Example, to get red 100% solid (non-transparent) use setPivotColor(0xFF0000, 1)

    Parameters

    color*
    Number
    RBG Hex color.
    opacity
    Number
    Opacity value from 0 (transparent) to 1 (opaque).
    * Required

    setPivotPoint(newPivot,preserveView,isset)

    Set the current pivot point and pivot set flag. If the pivot indicator is active its position will be updated accordingly. If a temporary pivot was previously applied, its saved state will be cleared.

    Parameters

    newPivot*
    THREE.Vector3
    The world space position of the new pivot point.
    preserveView*
    boolean
    If false the camera’s view direction will change to look at the new pivot point. If true the camera’s view will not be changed.
    isset*
    boolean
    The new state of the pivot set flag.
    * Required

    See

    setPivotSize(scale)

    Changes the pivot graphic size.

    Parameters

    scale*
    Number
    Default size value is 1
    * Required

    setSize()

    Changes the pivot graphic size. Set default size with scale value of 1.

    setTemporaryPivot(newPivot)

    Allows the caller to save the current pivot and replace it with a new location. If while the temporary pivot is active a new pivot is set via the setPivotPoint method, the saved pivot will be cleared to avoid restoring an out of date pivot location.

    Parameters

    newPivot*
    THREE.Vector3
    The new pivot to be assigned or null to clear any previously saved pivot.
    * Required

    transitionView(pos,coi,fov,up,worldUp,reorient,pivot)

    This method triggers a camera view transition as specified by the parameters.

    Parameters

    pos*
    THREE.Vector3
    The new world space position of the camera.
    coi*
    THREE.Vector3
    The new center of interest (look at point).
    fov*
    number
    The new field of view for the camera in degrees.
    up*
    THREE.Vector3
    The new camera up direction.
    worldUp*
    THREE.Vector3
    The new world up direction.
    reorient*
    boolean
    If true the given camera up parameter is ignored and a new up direction will be calculated to be aligned with the given world up direction.
    pivot*
    THREE.Vector3
    The new pivot point.
    * Required
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.