
MAD Gaze GLOW & GLOW Plus: Camera SDK for Unity
v2021.2 (Release Date: 06/18/2021)
- Updates
[Scene Tracking SDK]
- Standardize application flow for Scene Tracking
- Developers can now customise the Animation and Virtual Planes on their apps.
- Different callbacks among all state changes are now available.
- Two control modes are now available, Arbitary-Placement mode and Center-Placement mode.
View historical changes
Build History
Capabilities
Camera SDK for Unity provides the following functions with GLOW Camera:
Prerequisite
*This SDK is applicable to both MAD Gaze GLOW and MAD Gaze GLOW Plus model.
The application shall be
- an Android application
- with Target SDK at 27 (Android 8.1 'Oreo')
- with Minimum SDK at 27 (Android 8.1 'Oreo')
- with Landscape Left/Right orientation
Tested Unity Editor Versions
- Unity 2019.4.1
- Unity 2019.3.12
- Unity 2019.2.3
Getting Started
- Download the Unity Package here.
- Double Tap on the downloaded package and import the files.
- You are ready to develop GLOW-enabled apps.
Adding GLOW Camera into my scene
- Drag prefab MGCamera from MADGaze/Demo/Prefabs into your scene.
- Create an UI/Image object into your scene.
- Set the dimension of the created Image object to 680x480.
- Open the Inspector view of MGCamera.
- Drag the created Image object to Image Preview of MAD Gaze Camera (Script) in MGCamera.
- You are now able to display the camera preview from the created Image object.
Handle Camera Preview manually
- Drag prefab MGCamera from MADGaze/Demo/Prefabs into your scene.
- You are ready to handle the camera data when it is available.
To retrieve video(preview) data with following code segment.
Texture2D mTexture2D;
public Image ImagePreview;
lock(mTexture2D) {
byte[] data = SplitCamera.Instance.getPreviewResult();
if(data != null) {
mTexture2D.LoadImage(data);
Sprite sprite = Sprite.Create(
mTexture2D,
new Rect(0, 0, mTexture2D.width, mTexture2D.height),
new Vector2(.5f, .5f)
);
}
}
Photo Capture
SplitCamera.Instance.takePicture(
(string path)=>{
},
(int errorCode)=>{
}
);
Video Capture
Start Recording
SplitCamera.Instance.startRecording();
Stop Recording
SplitCamera.Instance.stopRecording();
Video Callbacks
SplitCamera.Instance.setRecordVideoCallback(
(string path) => {
},
(int errorCode) => {
}
);
Sample Scene
You can check CameraDemo in MADGaze/Demo/Scenes.
Troubleshooting
-
Q: Why the permission dialog never prompt on my Android 10 device?
It is because the native bug doesn't allow you to prompt the permission dialog on Android Q devices with Target SDK newer than 28. You have to set Target SDK at 27 or below in order to make it work.
Changelog
v2021.2 (Release Date: 06/18/2021)
- Updates
[Scene Tracking SDK]
- Standardize application flow for Scene Tracking
- Developers can now customise the Animation and Virtual Planes on their apps.
- Different callbacks among all state changes are now available.
- Two control modes are now available, Arbitary-Placement mode and Center-Placement mode.
v2021.1 (Release Date: 02/10/2021)
v1.3.0 (Release Date: 08/19/2020)
- First Release
- Scene Tracking SDK: This SDK allows user to recognize table-sized plain surface patterns and place the target to the tracked surface.
- Updates
- All SDK: Support USB Connection with MAD Gaze Adapters.
v1.1.0 (Release Date: 07/10/2020)
- First Release
- Head Tracking SDK: This SDK allows users to control the application via operating with head rotation.
v1.0.0 (Release Date: 06/29/2020)
- First Release
- Camera SDK: This SDK allows users to access the camera with codes.
Disclaimer
This library is licensed under the MAD Gaze - Terms of Use.