AR Camera ACCELEROMETER — augmented reality for 90% of all mobile devices without using gyroscope and compass, blends game objects and information with the surrounding environment.
Mobile camera implements markerless augmented reality (AR) by using Unity Accelerometer and video camera on the player’s mobile device to display 2D or 3D objects as though they were in the real world.
Accelerometer vs Gyroscope
90% of all mobile devices have an accelerometer and video camera but only 20% have a gyroscope.
If you want greater coverage of devices, but less accuracy and stability, use AR Camera ACCELEROMETER.
You can also try to use both cameras for different cases.
Different devices have different accelerometers, and therefore different deviations and drifts.
Check also Top AR Engines for Unity.
AR Camera in Pokemon GO
You do not need to rotate or to move the camera in Unity Editor. You can position your own game objects in place of the demo objects.
There are 3 different forms of tracking.
Only one at the same time can be selected for correct tracking.
The asset does not use a neural network to surfaces recognition. There is no surface recognition.
Tilting the phone away from yourself or toward yourself turns the camera in the game up or down.
It is used to track rotation using camera and Unity Accelerometer module. For rotation around the Y axis, an algorithm compares the pixel changes to the previous and current frames.
It is used to track rotation using the only unity accelerometer with an approximation.
It consumes fewer resources than camera tracking and probably it is compatible with 90% smartphones.
Tilting the phone to the left or right rotates the camera about the Y-axis.
None Camera XZ Rotation
It is previous “None Camera” tracking but tilting the phone to the left or right rotates the camera about the Z-axis.
You can test demo scene right in the Unity Editor with Unity Remote app. It supports accelerometer and device camera streams through USB-connection. But my testing device with Unity 2017.1 supports the only accelerometer for Unity Remote.
Besides, keep in mind, one Unity bug (WEBCAMTEXTURE.WIDTH/HEIGHT ALWAYS RETURNS 16) is still active if you press “Play” in the Unity Editor 2017.1. So do not use laptop webcam for testing of camera tracking.
- Lenovo A606 with Android 4.4;
- Default orientation > Landscape left.
- If we look straight down, the camera starts to rotate around the Y-axis very quickly.
- Camera tracking does not respond to very fast movements (excessive motion, blurred images).
- Camera tracking needs good illumination of the environment.
Advantages of AR Camera ACCELEROMETER
An accelerometer is an internal mobile sensor that will measure acceleration forces: static (the constant force of gravity pulling at your feet) or dynamic (caused by moving or vibrating the accelerometer):
- No using of Gyro and Compass;
- Wide Coverage of Devices;
- 3 different forms of Tracking.
Unity has Input.acceleration (last measured linear acceleration of a device in three-dimensional space).
Check the current version of AR Camera Accelerometer on Asset Store.
The latest versions will be added as soon as possible.
- Unity version => 2018.3.7;
- Fix low FPS in Unity Editor.
- Unity version => 2018.1;
- Publisher Window;