Skip to main content
Practitioner ⭐️
February 8, 2023
Solved

Learn Cognite 3D Model

  • February 8, 2023
  • 27 replies
  • 451 views

Learn Cognite 3d model, focus object, fit camera, search assets highlight object etc..

    Best answer by Lars Moastuen

    To focus at a clicked object in Reveal, you can do

    1. Get “Point intersection with the object” using Cognite3DViewer.getIntersectionFromPixel(offsetX, offsetY).
    2. Create a bounding box around intersection point like

      const boundingBox = new THREE.Box3();
      boundingBox.setFromCenterAndSize(intersection.point, new THREE.Vector3(1, 1, 1));
    3.  Use this bounding box in Cognite3DViewer.fitCameraToBoundingBox()
      viewer.fitCameraToBoundingBox(boundingBox, 250);

       

    Note that rather than using bounding box directly from the CDF API, it’s recommended to use https://cognitedata.github.io/reveal-docs/docs/api/classes/cognite_reveal.CogniteCadModel#getboundingboxbynodeid to get bounding box for a given node as this accounts for any transformation active on the model.

    27 replies

    Lars Moastuen
    Expert ⭐️⭐️⭐️⭐️
    Expert ⭐️⭐️⭐️⭐️
    February 14, 2023

    Unfortunately there are no 360 images available in the demo project currently.

    Lars Moastuen (Software Engineer, Atlas AI)
    Practitioner ⭐️
    February 14, 2023

    ok, thanks

    Practitioner ⭐️
    February 16, 2023
    1. I would like to know how an Asset id is connected to its respective 3D model 
    Practitioner ⭐️⭐️⭐️
    February 16, 2023
    1. I would like to know how an Asset id is connected to its respective 3D model 

    Details of CDF assets with 3D models is available in documentation at https://cognitedata.github.io/reveal-docs/docs/api/classes/cognite_reveal.AssetNodeCollection/

    Practitioner ⭐️
    February 16, 2023

    Assets API

    https://docs.cognite.com/api/v1/#tag/Assets

    3d Model API

    https://docs.cognite.com/api/v1/#tag/3D-Models/operation/get3DModels

    I have assets id, The Assets id connected to its respective 3d model

    Please share Which API I call.

    Practitioner ⭐️
    February 16, 2023
    Practitioner ⭐️
    February 23, 2023

    I have three assets Aker BP, Reverse osmosis, Vulkan Control Room. I click one assets then only load a part of the 3D model. (Aker BP respective 3D Model, Reverse osmosis respective 3D model, Vulkan Control Room respective 3D Model.)

    like this.