Skip to main content
Practitioner ⭐️
Feb 8, 2023 5:26 AM UTC
Solved

Learn Cognite 3D Model

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

    Lars Moastuen
    Expert ⭐️⭐️⭐️⭐️
    Feb 8, 2023 7:01 PM UTC

    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.

    Lars Moastuen (Software Engineer, Atlas AI)

    27 replies

    Practitioner ⭐️⭐️⭐️
    Feb 10, 2023 10:12 AM UTC

    I add await but again error comming.

    Can you confirm if 360 images are loaded?

    Practitioner ⭐️
    Feb 10, 2023 10:25 AM UTC

    It return empty object.

    I have 3d Model

    I try to achieve add circle then click rotate camera.

     

    Practitioner ⭐️⭐️⭐️
    Feb 10, 2023 10:26 AM UTC

    I add await but again error comming.



    Which version of Reveal are you using? Image360Collection.on(...) was recently introduced in Reveal 4.1.0.

    Practitioner ⭐️
    Feb 10, 2023 10:28 AM UTC

    My version is  "@cognite/reveal": "^4.0.0",

    Practitioner ⭐️⭐️⭐️
    Feb 10, 2023 10:31 AM UTC

    My version is  "@cognite/reveal": "^4.0.0",

    Ok, please update the dependency (as yarn.lock / npm.lock may still have 4.0.0 set).

    Practitioner ⭐️
    Feb 11, 2023 4:10 AM UTC

    please share sample code.

    Practitioner ⭐️⭐️⭐️
    Feb 11, 2023 12:00 PM UTC

    please share sample code.

    Documentation covering 360 images can be found here: https://cognitedata.github.io/reveal-docs/docs/examples/image360

    Practitioner ⭐️
    Feb 13, 2023 4:11 AM UTC

    1.what is site_id ?

    2.how to find site_id?

    Practitioner ⭐️⭐️⭐️
    Feb 13, 2023 8:13 AM UTC

    1.what is site_id ?

    2.how to find site_id?

    Documentation about 360 images data is available at https://docs.cognite.com/cdf/3d/guides/360images_upload/, you will find required details related to site_id & more about 360 image data

    Practitioner ⭐️
    Feb 14, 2023 10:55 AM UTC

    Hi. Please share image uploaded site_id.