How to get viewer data from viewpoint in Navis api?

How to get viewer data from viewpoint in Navis api?

preeti.kumari9TBN6
Enthusiast Enthusiast
692 Views
3 Replies
Message 1 of 4

How to get viewer data from viewpoint in Navis api?

preeti.kumari9TBN6
Enthusiast
Enthusiast

I have the viewpoint and I want to get the data of the <viewer> tag from it. How can I calculate it or get the values under viewer field.

public partial class exchangeViewpointsViewViewpointViewer
{

private decimal radiusField;

private decimal heightField;

private decimal actual_heightField;

private decimal eye_heightField;

private string avatarField;

private string camera_modeField;

private decimal first_to_third_angleField;

private decimal first_to_third_distanceField;

private decimal first_to_third_paramField;

private byte first_to_third_correctionField;

private byte collision_detectionField;

private byte auto_crouchField;

private byte gravityField;

private decimal gravity_valueField;

private decimal terminal_velocityField;

 

I want the data for all these fields. 

0 Likes
Accepted solutions (1)
693 Views
3 Replies
Replies (3)
Message 2 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @preeti.kumari9TBN6 ,

 

Could you please explain your issue a bit more using screenshots?

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

preeti.kumari9TBN6
Enthusiast
Enthusiast

Hello @naveen.kumar.t 

When we export the viewpoint, it exports in the XML format and we get the viewer data. I want to get this data through API to create this XML file of viewpoint.

preetikumari9TBN6_0-1694413021999.png

This is a viewpoint and I want to fetch each piece of information to create this XML with API. I can able to get the camera data but not the viewer data.

0 Likes
Message 4 of 4

Chuong.Ho
Advocate
Advocate
Accepted solution

Hi  @preeti.kumari9TBN6, what is your mean is viewer data ? 

In camerajson basically provided for you viewer data and another information of camera like :

```

{
    "Type": "AutodeskCommonCamera",
    "Version": 1,
    "UnitsToMetersScaleFactor": 0.30480000000000002,
    "WorldUpDirection": [
        0,
        0,
        1
    ],
    "WorldFrontDirection": [
        0,
        1,
        2.2204460492503126e-16
    ],
    "WorldRightDirection": [
        1,
        0,
        0
    ],
    "Position": [
        -117.58239151880313,
        -130.12171930160338,
        376.23096384271014
    ],
    "ViewDirection": [
        0.60943172372342436,
        0.41551197393165662,
        -0.67523534685242437
    ],
    "UpDirection": [
        0.55790202063357675,
        0.38037890190162466,
        0.73760234975295869
    ],
    "Projection": "Perspective",
    "VerticalExtent": 21.837296418700586,
    "HorizontalExtent": 11.516059694611601,
    "TargetDistance": 10.337971027663812,
    "NearDistance": 0,
    "NearDistanceType": "Auto",
    "FarDistance": 0,
    "FarDistanceType": "Auto",
    "UpOffset": 0,
    "RightOffset": 0,
    "ImageFit": "Vertical",
    "HorizontalScale": 1,
    "ApertureDiameter": 0,
    "ShutterSpeed": 0
}

```

Chuong Ho

EESignature

0 Likes