Start a new topic

Loading 3D model near GeoLocation

Loading 3D model near GeoLocation


Hi,

How did you exactly solve the problem? Could you demonstrate?

Thanks in advance.

Hi :)

in locationChanged I did this...

I iterated by all the markeList elements

for(i=0;i< World.markerList.length;i++)

Then I checked if I'm near the POI

if (Math.round(newLocation2.distanceToUser()) <= 5)

So I created a new var with the geoobject array

var markerNear = World.markerList;

And I used markerNear for all. So if you want show the model and delete the POI from the camera, do this

 

markerNear.markerObject.drawables.removeCamDrawable();


markerNear.markerObject.drawables.addCamDrawable(model);

 

And to undo this


markerNear.markerObject.drawables.removeCamDrawable(model);

markerNear.markerObject.drawables.addCamDrawable();



 

Hi,

I want to load all the POI and, when the user is near (about 2 meters) to a POI, I want to show him a 3D model...

I'm using the sample of Multiplepoi modified... This is the code

 

for(i=0;i< World.markerList.length;i++)

            {

                // Updating POI distance

                var newLocation2 = World.markerList.markerLocation;

                document.getElementById("page1").innerHTML = "a"+World.markerList.markerLocation;

                var distanceUpdate2 = (newLocation2.distanceToUser() > 999) ? ((newLocation2.distanceToUser() / 1000).toFixed(2) + " km") : (Math.round(newLocation2.distanceToUser()) + " m");

                document.getElementById("page1").innerHTML = "a"+distanceUpdate2;

                World.markerList.descriptionLabel.text = distanceUpdate2;

                

                // Loading 3D Model if distance is <= 2m

                

                if (Math.round(newLocation2.distanceToUser()) <= 15)

                {

                    var model = new AR.Model("3d/"+World.markerList.id+".wt3", {

                                             onLoaded: function()

                                             {

                                             var geoObject = new AR.GeoObject(World.markerList.markerLocation);

                                             geoObject.drawables.addCamDrawable(model);

                                             document.location = "architectsdk://clickOnObject?param="+World.markerList.name;

                                             //document.location = "architectsdk://clickOnCar";

                                             //this.scale.x = 0.01;

                                             //this.scale.y = 0.01;

                                             //this.scale.z = 0.01;

                                             

                                             },

                                             /*onClick: function()

                                             {

                                             document.location = "architectsdk://clickOnObject?param="+World.markerList.name;

                                             }*/

                                             });

                }

 

But finished to load the 3D model, an error occured: TypeError: 'undefined' is not an object (evaluating 'World.markerList.markerLocation')

onLoadedmultiplepois.js:88:99

triggerade.js:1:421464

 

That's why?

Sorry, I solved creating a new array with information of the nearest marker (model hadn't to load data from World.markerList)

 
Login or Signup to post a comment