我们可以在Wikitude JAVASCRIPT API中添加带有遮挡的3D模型AR.GeoLocation吗?

时间:2018-01-20 05:19:46

标签: javascript android wikitude wikitude-sdk

是否可以在AR GeoObject中使用3D模型AR.GeoLocation遮挡?

当您进入预定义的地理围栏区域时,我们正在制作一个应用程序,可以在建筑物的某个高度显示广告横幅。

现在,在当前阶段,使用wikitude,我们可以将AR对象模型放置在建筑物上。但问题在于,能够看到模型超越墙壁并在目标建筑物之间建造。我们希望避免这种情况,只有在目标大楼和相机之间没有障碍时才会展示广告。

我的困惑是我们希望封堵器在其行为中是动态的。因此,无论是建筑物,树木,手还是其他任何东西,都应该应用效果,并且不会为被阻挡的部分显示模型。

另外,我附上了几个网址供您参考,以展示我们正在寻找的内容

  1. https://www.youtube.com/watch?v=a5NLRMEnu2U
  2. https://www.youtube.com/watch?v=CQFkTvEcfpk
  3. var World = {
      loaded: false,
      rotating: false,
    
      init: function initFn() {
        this.createModelAtLocation();
      },
    
    
      createModelAtLocation: function createModelAtLocationFn() {
    
        /*
            First a location where the model should be displayed will be defined. This location will be relativ to the user.    
        */
        //var location = new AR.RelativeLocation(null, 5, 0, 2);
    
        var geoLoc = new AR.GeoLocation(23.027390, 72.558721, 320.);//National Handloom
        //var geoLoc = new AR.GeoLocation(23.028350, 72.506674, 320.);//Iscon
        //var geoLoc = new AR.GeoLocation(26.206274, 73.048096, 320.);//Jodhpur
        //var geoLoc = new AR.GeoLocation(40.319421, -74.631490, 320.);//client
    
        var location = new AR.RelativeLocation(geoLoc, 10, 10, 10);
    
        /*
            Next the model object is loaded.
        */
        var modelEarth = new AR.Model("assets/earth.wt3", {
          onLoaded: this.worldLoaded,
          scale: {
            x: 10,
            y: 10,
            z: 10
          }
        });
    
        var indicatorImage = new AR.ImageResource("assets/indi.png");
    
        var indicatorDrawable = new AR.ImageDrawable(indicatorImage, 0.1, {
          verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
        });
    
        /*
            Putting it all together the location and 3D model is added to an AR.GeoObject.
        */
        var obj = new AR.GeoObject(location, {
          drawables: {
            cam: [modelEarth],
            indicator: [indicatorDrawable]
          }
        });
      },
    
      worldLoaded: function worldLoadedFn() {
        World.loaded = true;
        var e = document.getElementById('loadingMessage');
        e.parentElement.removeChild(e);
      }
    };
    
    World.init();
    

    请告诉我

    由于 Umesh制作。

0 个答案:

没有答案