Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by AR_newbie · Jan 17, 2016 at 05:35 PM · augmented-realitygps

AR app using GPS data

Hello all!

I'm trying to create an AR app which use GPS and some external data. It's similar to existent ones like Nokia City Lens or Wikitude World Browser. So it's without any markers (as I understand).

I tried search any tips here but unsuccessfully.

Nokia City Lens example: https://www.youtube.com/watch?v=55Qdem9pJxY

Wikitude World Browser example: https://www.youtube.com/watch?v=Tep9x-KOPy0

What I need to know how to draw some specific marker(like a small pic+description) on the screen according to it's and mine GPS coordinates.

The target's GPS coordinates are provided by some external source via WiFi (also how to do that?).

All help is welcome (especially the code examples)!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AR_newbie · Feb 04, 2016 at 05:05 PM 0
Share

Some answers I was managed to found: A small pic+description could be done with GUIContent.

http://answers.unity3d.com/questions/542274/gui-button-with-both-texture-and-text.html

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by anildas · Jan 18, 2016 at 04:52 AM

Since you use GPS data, I'm assuming it's a mobile app. As you can predict user location values through multiple ways (Using actual GPS data and using network data like mobile or WiFi but with different accuracy), You can use the lat-long coordinates to find the azimuth of target location and use that to find where is it, with respect to your user location.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AR_newbie · Jan 19, 2016 at 12:23 AM 0
Share

Thanks for the tip! In suggested way I can only have the azimuth to the target. That's something but I wonder how to draw a marker on the view not only the direction. If we have some obstacle (a building for example) at the marked direction - that's not clear if your target just before the building or on the 4th floor or on the other side of the bilding and so on. I assume that a rangefinder could be used (dunno if there a unity3d solutions available) + a height data provided with gps coordinates as well.

avatar image anildas · Jan 20, 2016 at 04:20 AM 0
Share

You can maybe look at GeoCoordinate Class in the location package which has latitude and longitude coordinates and may also include altitude and its accuracy. But I don't think (at least as of now) you will be able to deter$$anonymous$$e the exact vertical position of your target. If you find a better way, please let me know as well.

avatar image
1

Answer by AR_newbie · Jan 21, 2016 at 01:44 PM

Please advise me guys,

Now I'm looking how to draw a marker of the target on my compass bar (done with gui.label).

I have 2 GPS coordinates (first of my target and the second of my own).

Also I've found the following topic :

http://answers.unity3d.com/questions/908877/get-azimuth-from-relative-direction.html

and I have a couple of questions:

1)

var azimuth : float = Mathf.Atan2(direction.x, direction.z)*Mathf.Rad2Deg

  • why this line has this

    *Mathf.Rad2Deg

?

2) As I understand I need to calculate these latitude-longitute coordinates like this (to calculate the bearing):

Bearing from point A to B, can be calculated as,

β = atan2(X,Y),

where, X and Y are two quantities and can be calculated as:

X = cos θb * sin ∆L

Y = cos θa sin θb – sin θa cos θb * cos ∆L ‘L’ be the longitude, ‘θ’ be latitude,

How to choose which point will be "a" and "b" for the formula above?

I've took this formula from http://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/

There is an example there which could clarify what I mean in 2nd question

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AR_newbie · Jan 25, 2016 at 05:18 PM 0
Share

*$$anonymous$$oved to separated question

avatar image anildas · Jan 27, 2016 at 03:56 AM 0
Share

Hi,

  1. "$$anonymous$$athf.Atan2(direction.x, direction.z)" will give you the inverse tan of x and z in radians. If you need to convert it into degrees, you can multiply it with the constant "$$anonymous$$athf.Rad2Deg".

  2. Since you need to calculate the bearing from your location to the target location, a can be your (user's) location and b can be the target.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

38 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trying to make an AR android app based on GPS location with a videoclip (instrad of a 3d object 0 Answers

how to place 2d/3d objects in real world based on location and altitude... 0 Answers

¿How can I place an object based on GPS location? 0 Answers

Placing lare objects at GPS site using MARS and / or AR + GPS plugin 0 Answers

Problem with AR+GPS - GPS Stage Object goes automatically into ARLocationRoot 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges