How to visualize ARKit WorldMap with Three.js?How do you change the size of figures drawn with matplotlib?Learning WebGL and three.jsAnimating Canvas Billboard in THREE.jsLabelling particles in a ParticleSystem/PointCloud in THREE.jsARKit plane visualizationHow to draw UIViews in ARKit?Animating between ARAnchor orientationsARKit – How to generate a worldMap for big environment?Why should I add node to superNode in renderer(_:nodeFor:) in ARKitARKit share worldmap session file

Did Apollo leave poop on the moon?

Is there a way to improve my grade after graduation?

Generate a random point outside a given rectangle within a map

The meaning of "scale" in "because diversions scale so easily wealth becomes concentrated"

Ubuntu show wrong disk sizes, how to solve it?

Can attackers change the public key of certificate during the SSL handshake

Vibration on the guitar when playing two strings

Why do proponents of guns oppose gun competency tests?

Is an "are" omitted in this sentence

In MTG, was there ever a five-color deck that worked well?

Getting an entry level IT position later in life

Find a text string in a file and output only the rest of the text that follows it?

Is a switch from R to Python worth it?

How do I get the =LEFT function in excel, to also take the number zero as the first number?

Tile the chessboard with four-colored triominoes

Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?

What are the function of EM and EN spaces?

Is the first page of a novel really that important?

If the interviewer says "We have other interviews to conduct and then back to you in few days", is it a bad sign to not get the job?

Which genus do I use for neutral expressions in German?

Our group keeps dying during the Lost Mine of Phandelver campaign. What are we doing wrong?

How to switch an 80286 from protected to real mode?

Ancients don't give a full level?

Write The Shortest Program To Check If A Binary Tree Is Balanced



How to visualize ARKit WorldMap with Three.js?


How do you change the size of figures drawn with matplotlib?Learning WebGL and three.jsAnimating Canvas Billboard in THREE.jsLabelling particles in a ParticleSystem/PointCloud in THREE.jsARKit plane visualizationHow to draw UIViews in ARKit?Animating between ARAnchor orientationsARKit – How to generate a worldMap for big environment?Why should I add node to superNode in renderer(_:nodeFor:) in ARKitARKit share worldmap session file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to visualize PlaneAnchorNodes detected by ARKit via an iOS app in a browser using three.js, and I can't get the planes that I'm visualizing to match up with the pointcloud data from the ARWorldMap that I'm also exporting.



I'm exporting each ARPlaneAnchor's position, length, width, and rotation. Here's a .debugDescription of an example PlaneAnchorNode:



0, <ClientCore.PlaneAnchorNode: 0x10170d540 'HorizontalPlaneAnchor' pos(-0.034809 -0.391279 0.130804) rot(0.000000 -1.002311 0.000000 0.011389) scale(1.000000 1.000000 1.000000) | 5 children>


I'm exporting as a CSV, which looks like this:



id,type,orientation,pos_x,pos_y,pos_z,rot_w,rot_x,rot_y,rot_z,length,width
0,anchorPlane,VerticalPlaneAnchor,4.4324,0.3275,-4.2946,3.0899,0.0277,-0.6809,0.7319,0.2359,1.0074
1,anchorPlane,VerticalPlaneAnchor,4.8228,-0.8363,-5.9102,3.1184,0.0118,-0.7006,0.7134,0.2723,0.4500
2,anchorPlane,HorizontalPlaneAnchor,5.5023,-1.1353,-2.8441,0.5499,0.0002,1.0000,0.0000,0.5798,0.4390
3,anchorPlane,HorizontalPlaneAnchor,5.0866,0.2323,-4.4964,0.0583,-0.0014,1.0001,-0.0003,0.2657,0.7294


For my visualization with three.js, I add the pointcloud and anchor planes to the scene, and set up the anchors like this:



// anchor planes
for (i = 0; i < planes_dataset.length; i++)

var pos_x = planes_dataset[i].pos_x;
var pos_y = planes_dataset[i].pos_y;
var pos_z = planes_dataset[i].pos_z;
var rot_w = planes_dataset[i].rot_w;
var rot_x = planes_dataset[i].rot_x;
var rot_y = planes_dataset[i].rot_y;
var rot_z = planes_dataset[i].rot_z;
var width = planes_dataset[i].width;
var length = planes_dataset[i].length;

let cube_height = 0.1;

var anchorGeometry = new THREE.BoxGeometry( width, cube_height, length );
var anchorMaterial = new THREE.MeshPhongMaterial( color: 0x7a7978, opacity: 0.5, transparent: true );
var anchorCube = new THREE.Mesh( anchorGeometry, anchorMaterial );

if (planes_dataset[i].orientation == "VerticalPlaneAnchor")
anchorCube.rotateX( - Math.PI / 2 ); // make vertical


//const quaternion = new THREE.Quaternion(rot_x, rot_y, rot_z, rot_w);
//anchorCube.applyQuaternion(quaternion); // Apply Quaternion
//anchorCube.quaternion.normalize(); // Normalize Quaternion

scene.add(anchorCube);
anchorCube.position.set(pos_x, pos_y, pos_z);



My challenge is that I haven't been able to figure out how to use the rotation correctly, and the planes are not rotated or positioned correctly vs. the pointcloud. Screen shot attached, using my staircase to line up point cloud data and detected planes. Any ideas would be much appreciated!



arworldmap visualization of my staircase in three.js



Full code in the "pointcloud visualization" branch on Github here: https://github.com/zredlined/control-my-mekamon/tree/pointcloud_visualization/pointcloud_visualization










share|improve this question
































    0















    I'm trying to visualize PlaneAnchorNodes detected by ARKit via an iOS app in a browser using three.js, and I can't get the planes that I'm visualizing to match up with the pointcloud data from the ARWorldMap that I'm also exporting.



    I'm exporting each ARPlaneAnchor's position, length, width, and rotation. Here's a .debugDescription of an example PlaneAnchorNode:



    0, <ClientCore.PlaneAnchorNode: 0x10170d540 'HorizontalPlaneAnchor' pos(-0.034809 -0.391279 0.130804) rot(0.000000 -1.002311 0.000000 0.011389) scale(1.000000 1.000000 1.000000) | 5 children>


    I'm exporting as a CSV, which looks like this:



    id,type,orientation,pos_x,pos_y,pos_z,rot_w,rot_x,rot_y,rot_z,length,width
    0,anchorPlane,VerticalPlaneAnchor,4.4324,0.3275,-4.2946,3.0899,0.0277,-0.6809,0.7319,0.2359,1.0074
    1,anchorPlane,VerticalPlaneAnchor,4.8228,-0.8363,-5.9102,3.1184,0.0118,-0.7006,0.7134,0.2723,0.4500
    2,anchorPlane,HorizontalPlaneAnchor,5.5023,-1.1353,-2.8441,0.5499,0.0002,1.0000,0.0000,0.5798,0.4390
    3,anchorPlane,HorizontalPlaneAnchor,5.0866,0.2323,-4.4964,0.0583,-0.0014,1.0001,-0.0003,0.2657,0.7294


    For my visualization with three.js, I add the pointcloud and anchor planes to the scene, and set up the anchors like this:



    // anchor planes
    for (i = 0; i < planes_dataset.length; i++)

    var pos_x = planes_dataset[i].pos_x;
    var pos_y = planes_dataset[i].pos_y;
    var pos_z = planes_dataset[i].pos_z;
    var rot_w = planes_dataset[i].rot_w;
    var rot_x = planes_dataset[i].rot_x;
    var rot_y = planes_dataset[i].rot_y;
    var rot_z = planes_dataset[i].rot_z;
    var width = planes_dataset[i].width;
    var length = planes_dataset[i].length;

    let cube_height = 0.1;

    var anchorGeometry = new THREE.BoxGeometry( width, cube_height, length );
    var anchorMaterial = new THREE.MeshPhongMaterial( color: 0x7a7978, opacity: 0.5, transparent: true );
    var anchorCube = new THREE.Mesh( anchorGeometry, anchorMaterial );

    if (planes_dataset[i].orientation == "VerticalPlaneAnchor")
    anchorCube.rotateX( - Math.PI / 2 ); // make vertical


    //const quaternion = new THREE.Quaternion(rot_x, rot_y, rot_z, rot_w);
    //anchorCube.applyQuaternion(quaternion); // Apply Quaternion
    //anchorCube.quaternion.normalize(); // Normalize Quaternion

    scene.add(anchorCube);
    anchorCube.position.set(pos_x, pos_y, pos_z);



    My challenge is that I haven't been able to figure out how to use the rotation correctly, and the planes are not rotated or positioned correctly vs. the pointcloud. Screen shot attached, using my staircase to line up point cloud data and detected planes. Any ideas would be much appreciated!



    arworldmap visualization of my staircase in three.js



    Full code in the "pointcloud visualization" branch on Github here: https://github.com/zredlined/control-my-mekamon/tree/pointcloud_visualization/pointcloud_visualization










    share|improve this question




























      0












      0








      0








      I'm trying to visualize PlaneAnchorNodes detected by ARKit via an iOS app in a browser using three.js, and I can't get the planes that I'm visualizing to match up with the pointcloud data from the ARWorldMap that I'm also exporting.



      I'm exporting each ARPlaneAnchor's position, length, width, and rotation. Here's a .debugDescription of an example PlaneAnchorNode:



      0, <ClientCore.PlaneAnchorNode: 0x10170d540 'HorizontalPlaneAnchor' pos(-0.034809 -0.391279 0.130804) rot(0.000000 -1.002311 0.000000 0.011389) scale(1.000000 1.000000 1.000000) | 5 children>


      I'm exporting as a CSV, which looks like this:



      id,type,orientation,pos_x,pos_y,pos_z,rot_w,rot_x,rot_y,rot_z,length,width
      0,anchorPlane,VerticalPlaneAnchor,4.4324,0.3275,-4.2946,3.0899,0.0277,-0.6809,0.7319,0.2359,1.0074
      1,anchorPlane,VerticalPlaneAnchor,4.8228,-0.8363,-5.9102,3.1184,0.0118,-0.7006,0.7134,0.2723,0.4500
      2,anchorPlane,HorizontalPlaneAnchor,5.5023,-1.1353,-2.8441,0.5499,0.0002,1.0000,0.0000,0.5798,0.4390
      3,anchorPlane,HorizontalPlaneAnchor,5.0866,0.2323,-4.4964,0.0583,-0.0014,1.0001,-0.0003,0.2657,0.7294


      For my visualization with three.js, I add the pointcloud and anchor planes to the scene, and set up the anchors like this:



      // anchor planes
      for (i = 0; i < planes_dataset.length; i++)

      var pos_x = planes_dataset[i].pos_x;
      var pos_y = planes_dataset[i].pos_y;
      var pos_z = planes_dataset[i].pos_z;
      var rot_w = planes_dataset[i].rot_w;
      var rot_x = planes_dataset[i].rot_x;
      var rot_y = planes_dataset[i].rot_y;
      var rot_z = planes_dataset[i].rot_z;
      var width = planes_dataset[i].width;
      var length = planes_dataset[i].length;

      let cube_height = 0.1;

      var anchorGeometry = new THREE.BoxGeometry( width, cube_height, length );
      var anchorMaterial = new THREE.MeshPhongMaterial( color: 0x7a7978, opacity: 0.5, transparent: true );
      var anchorCube = new THREE.Mesh( anchorGeometry, anchorMaterial );

      if (planes_dataset[i].orientation == "VerticalPlaneAnchor")
      anchorCube.rotateX( - Math.PI / 2 ); // make vertical


      //const quaternion = new THREE.Quaternion(rot_x, rot_y, rot_z, rot_w);
      //anchorCube.applyQuaternion(quaternion); // Apply Quaternion
      //anchorCube.quaternion.normalize(); // Normalize Quaternion

      scene.add(anchorCube);
      anchorCube.position.set(pos_x, pos_y, pos_z);



      My challenge is that I haven't been able to figure out how to use the rotation correctly, and the planes are not rotated or positioned correctly vs. the pointcloud. Screen shot attached, using my staircase to line up point cloud data and detected planes. Any ideas would be much appreciated!



      arworldmap visualization of my staircase in three.js



      Full code in the "pointcloud visualization" branch on Github here: https://github.com/zredlined/control-my-mekamon/tree/pointcloud_visualization/pointcloud_visualization










      share|improve this question
















      I'm trying to visualize PlaneAnchorNodes detected by ARKit via an iOS app in a browser using three.js, and I can't get the planes that I'm visualizing to match up with the pointcloud data from the ARWorldMap that I'm also exporting.



      I'm exporting each ARPlaneAnchor's position, length, width, and rotation. Here's a .debugDescription of an example PlaneAnchorNode:



      0, <ClientCore.PlaneAnchorNode: 0x10170d540 'HorizontalPlaneAnchor' pos(-0.034809 -0.391279 0.130804) rot(0.000000 -1.002311 0.000000 0.011389) scale(1.000000 1.000000 1.000000) | 5 children>


      I'm exporting as a CSV, which looks like this:



      id,type,orientation,pos_x,pos_y,pos_z,rot_w,rot_x,rot_y,rot_z,length,width
      0,anchorPlane,VerticalPlaneAnchor,4.4324,0.3275,-4.2946,3.0899,0.0277,-0.6809,0.7319,0.2359,1.0074
      1,anchorPlane,VerticalPlaneAnchor,4.8228,-0.8363,-5.9102,3.1184,0.0118,-0.7006,0.7134,0.2723,0.4500
      2,anchorPlane,HorizontalPlaneAnchor,5.5023,-1.1353,-2.8441,0.5499,0.0002,1.0000,0.0000,0.5798,0.4390
      3,anchorPlane,HorizontalPlaneAnchor,5.0866,0.2323,-4.4964,0.0583,-0.0014,1.0001,-0.0003,0.2657,0.7294


      For my visualization with three.js, I add the pointcloud and anchor planes to the scene, and set up the anchors like this:



      // anchor planes
      for (i = 0; i < planes_dataset.length; i++)

      var pos_x = planes_dataset[i].pos_x;
      var pos_y = planes_dataset[i].pos_y;
      var pos_z = planes_dataset[i].pos_z;
      var rot_w = planes_dataset[i].rot_w;
      var rot_x = planes_dataset[i].rot_x;
      var rot_y = planes_dataset[i].rot_y;
      var rot_z = planes_dataset[i].rot_z;
      var width = planes_dataset[i].width;
      var length = planes_dataset[i].length;

      let cube_height = 0.1;

      var anchorGeometry = new THREE.BoxGeometry( width, cube_height, length );
      var anchorMaterial = new THREE.MeshPhongMaterial( color: 0x7a7978, opacity: 0.5, transparent: true );
      var anchorCube = new THREE.Mesh( anchorGeometry, anchorMaterial );

      if (planes_dataset[i].orientation == "VerticalPlaneAnchor")
      anchorCube.rotateX( - Math.PI / 2 ); // make vertical


      //const quaternion = new THREE.Quaternion(rot_x, rot_y, rot_z, rot_w);
      //anchorCube.applyQuaternion(quaternion); // Apply Quaternion
      //anchorCube.quaternion.normalize(); // Normalize Quaternion

      scene.add(anchorCube);
      anchorCube.position.set(pos_x, pos_y, pos_z);



      My challenge is that I haven't been able to figure out how to use the rotation correctly, and the planes are not rotated or positioned correctly vs. the pointcloud. Screen shot attached, using my staircase to line up point cloud data and detected planes. Any ideas would be much appreciated!



      arworldmap visualization of my staircase in three.js



      Full code in the "pointcloud visualization" branch on Github here: https://github.com/zredlined/control-my-mekamon/tree/pointcloud_visualization/pointcloud_visualization







      three.js visualization arkit






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 5:08







      Alex

















      asked Mar 27 at 3:34









      AlexAlex

      1253 silver badges15 bronze badges




      1253 silver badges15 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55369389%2fhow-to-visualize-arkit-worldmap-with-three-js%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55369389%2fhow-to-visualize-arkit-worldmap-with-three-js%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴