-
So first google map api.
How to use this in unity game? -
Next is Camera usage.
How to turn on camera and make game object onto it?
and other points?
So first google map api.
How to use this in unity game?
Next is Camera usage.
How to turn on camera and make game object onto it?
and other points?
Both have been answered several times and can be found with google too, but in short:
you will not be able to use google maps the same way as pokemon does with the free api limitations
Knew this would start popping up soon. Really should cash in on it with a video or too.
The game tech is realatively straight forward. Get the user location from the device, itâs part of the input class. Download the local map from Google. Place the user on the map. Download locations of interest from your own server, and place them on the map.
The AR is even simpler. Get a texture from the camera. Put it on a quad. Put your model in front of the quad. And you are done.
uGUIâŚ
So AR part is, when see the game video, the camera always turns on? so turn on camera seems easy, but how to put objects onto cameraâs realtime video shooting? At that time, camera is doing shooting? How to import that video in unity realtime?
How to get cameraâs realtime shooting reality video onto unity?
WebCamTexture.
And here I was in the process of writing lengthy text about OpenCV.
@leegod : I think you can get rough idea of camera orientation using sensors, even my 3 years old android tablet works ⌠OKAY with Google SKY (the tablet doesnât have a gyroscope, so the movement is jerky, because it relies on compass instead. Also this thing canât run Pokemon GO).
IIRC, OpenCV also had API for detecting markers (it also has API for accessing cameras) and reconstructing projection matrix from those, but I never really played with that (although I planned to). As I understand it, without markers there would be no information you could automatically use for building projection matrix for the camera, so youâll need some sort of database for ALL devices and sensors you support.
So, basically, using positional and gps data, figure out deviceâs approximate position in space then overlay 3d object using compatible projection⌠without depth information (phones donât exactly come with kinect sensors, as far as I know), itâll clip through webcam enviornment, but in the right circumstances it will be convincing enough. It is not a rocket science, pieces of the information can be found on the web, and youâll definitely need license from google for location and elevation dataâŚ
Speaking of which, google earth stores 3d data for some cities, and knows street boundaries. If thatâs accessible, it can be used to make game more convincing.
Actually, WebCamTexture alone will not suffice. You will have to use OpenCV to perform non-marker based motion detection. This will be implemented by a combination of device and camera properties (specifically device orientation and camera FOV) and calculating optical flow and recalculating a world projection matrix each camera frame. Then the 3D objects can be placed and the result will be AR. You could cut out all those steps by simply using Vuforia.
Dont do it.
If I remember right, I think solo-AAA Billy8675309 posted that heâs employed doing quite a bit of actual for-pay robotics work that uses OpenCV, if you decide to go down that rabbit hole. (I did, once, a few years back⌠one of those things I always meant to get back into some day, when I find an infinte amount of free timeâŚ)
You can get pretty close with just a straight webcam texture.
https://www.youtube.com/watch?v=2Y2y40eEU5E
Sure, it doesnât account for linear movement of the device. But neither does Pokemon Go. Try it, start up the game, see a Pokemon, turn on AR, then walk around the room. The Pokemon stays in the same place relative to the device, not the world. You canât âcircle roundâ a Pokemon. A Pokemon that starts off âahead and to the leftâ will always stay âahead and to the leftâ, no matter how far you travel.
Or do what everyone else does, and drive slowly down the street, making sure not to look up at the windshield. Be sure to focus on your smartphone, or youâll miss it.
This is perhaps an even better demonstration of my point. On a straight road, the Pokemon will remain in the same place relative to the drivers seat, no matter how far you drive.
![]()
And donât wear your seatbelt when you are Pokemon hunting, otherwise you may have trouble getting your phone to just the right angle.
And disable your airbags, because if they go off, they might block your camera.
Yes.
No. Havenât you been listening to anything Iâve been saying? Pokemon Go is an overlay. Its not true AR. You can completely block the lens and still catch Pokemon.
![]()
Just in case it wasnât obvious, Iâm not advocating playing the game while driving. Donât play the game while driving. If you are playing the game while someone else is driving, turn off the AR so that you donât need to remove your seat belt.
I only keep opening this thread because âpocket monster goâ makes my inner-10-year-old laugh. Every. Time.
Oh I didnât notice. I donât play Pokemon Go myself, but I expected a very robust tracking algorithm especially considering how much success it has seen. Yes, WebCamTexture will suffice.
PokĂŠmon is the international name. In Japan itâs Pocket Monsters.
I wouldnât doubt that it was a gameplay design decision rather than a technological limitation of their engineering team. I could imagine they prototyped it out, and found the experience not as user friendly or entertaining as other implementations.