Start a new topic

Placing objects at fixed positions and getting them to stay there.

Placing objects at fixed positions and getting them to stay there.


Hi hiral,
You can't automatically define an objects scale to be as big to fullfill the space between two geo locations. you need to to the calculations by yourself.

Best regards

Andreas

Hii Andreas,

 var geoLoc1 = new AR.GeoLocation(19.160801, 73.001427,13);


   var geoLoc2 = new AR.GeoLocation(19.088563, 72.999055,0);

   var dist = geoLoc2.distanceTo(geoLoc1);


  var location3 = new AR.RelativeLocation(geoLoc1,dist,0,2);

 here, I am placing the model at geoLoc1 and want to place between geoLoc1 and location3 but i want the model to scale automatically and fit between the given positions . Is there a way to do that?

 

 

Hi Claude,
You can simply use the Wikitude SDK example application as reference. All samples are setup to include the ADE correctly and if you open any exmaple .html file on a Desktop browser, It works out of the box.

Best regards

Andreas

Hi Andreas.  I'm actually asking about the list of architect objects that should display in a desktop browser according to the documentation. Yes, sorry, my path was all wrong due to trying things to get it to display.  I have the ade.js file in the same folder as the html page now. If I include the file source in the header of the html document, shouldn't the javasript object auto generate a context element in a tree when it loads which should appear below the html content? Here is the code.                                                                                             <html>                                                                                                                                                                                                                                                                               <head>             

<script type="text/javascript" src="ade.js"></script>    </head>
    <body>
    ...
    </body>
</html>

Hi Claude,
I'm not sure If you understand completely how the Wikitude SDK works. Paths that start with C:Android will not work on a mobile browser, so what should happen there? Why do you want to list all SDK classes? If you want to know which classes are available in JS, please refer to the JavaScript Reference which is part of the SDK download package or available online in our developer website section.

Best regards

Andreas

Hi Andreas.  Not sure if I'm completely misunderstanding the process here, but from what I gather, the first thing to do when creating an android app is to setup an Architect world which is simply an html page.  I've just used your sample code to test this, inserting the correct path in the placeholder and I should see a list of sdk classes.  But there are no autogen'd classes when I open this HTML page in IE. What am I doing wrong?                                                                                                                                                                         <html>
    <head>
        <script src="architect://architect.js"></script>
        <script src="C:Android\Projects\Architect Worlds\ade.js"></script>
    </head>
    <body>
    ...
    </body>
</html>
 

Hi Claude,
In our Geo examples we mainly use AR.RelativeLocations. The concept of these is that they are always relative to the current user location and if you move around, objects will follow you, so they never change there scale if you move around. What you need is a AR.GeoLocation. Geo locations are fixed to a certain latitude/longitude coordinate and stay at exact this place. When you move around, objects placed at geo locations will change there scale accordingly. 
To implement you described scenario, you need to set a AR.contect.locationChanged handler so that you get location updates in JS. When you need to create a new billboard, use the last received location, add any offset you need and pass it to a new AR.GeoLocation object. That should be all you need to do.

If you have any further question, please feel free to ask!

Best regards

Andreas

Hi. I'm new to Wikitude and just wanted to know if it has the capabilities I need for my AR app. I'll be using geo location eventually, but for now I just need to place a billboard-type object at a location relative to me, say 2 meters away, and I need this object to stay fixed. So if I move away from it, it needs to scale itself to appear further away (ie. it needs to get smaller) and then moving closer should yield the opposite result and in general just behave like a real world object in any given environment (within reason). I think this must be a basic function of the SDK.  But I had a look at the "3D model at geolocation" example and the augmented earth doesnt seem to behave in this fashion.  The earth just kind of follows you around. Same with the other POI based examples. Was this by design? or is it a limitation of some kind? I understand that with SLAM tracking which gets released later this year, it will make markerless tracking much more accurate and greatly improve responsiveness of the augmentations, and I look forward to it. But, at present would I be able to setup a decently-functioning scenario as I've described above?  I'll appreciate every bit of help in this regard. Thank you very much. Claude.
Login or Signup to post a comment