简体   繁体   中英

ar.js location based not placing at coordinates

So ar.js has a location based feature where you can place objects at certain coordinates. However no matter which coordinates I set it to the 3d object is placed on me, and sticks to me. My GPS may not be extremely accurate but its accurate enough within like a 500 foot radius. So it shouldn't show up when I set the coordinates to 0,0. I have tried it in both firefox and chrome. I also downloaded the libraries and stored them locally to get around the CORS issues, however nothing has seemed to fix it.

Code:

<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>GeoAR.js demo</title>
    <script src='https://aframe.io/releases/0.9.2/aframe.min.js'></script>
    <script src="./aframe-ar.min.js"></script>
    <script src="./aframe-extras.loaders.min.js"></script>
</head>

<body style='margin: 0; overflow: hidden;'>
    <a-scene
        vr-mode-ui="enabled: false"
        embedded
        arjs='sourceType: webcam; sourceWidth:1280; sourceHeight:960; displayWidth: 1280; displayHeight: 960; debugUIEnabled: false;'>
        <a-entity gltf-model="./Assets/magnemite/scene.gltf" rotation="0 180 0" scale="0.15 0.15 0.15" gps-entity-place="longitude: 0; latitude: 0;" animation-mixer/>
        <a-camera gps-camera rotation-reader></a-camera>
    </a-scene>
</body>

I've had a similar issue and discovered that I needed to enable location services for my browser app (Safari on IOS). That said, I'm still having problems with items following me around a bit so I'm not sure if that's the complete answer (I'm still looking).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM