English
Appearance
English
Appearance
Face AR corresponds to the face type.
It is mainly used to bind 3D content to the user's face, such as glasses, headwear, masks, makeup, face stickers, and so on.
A typical flow is:
tracked fires once a face is detectedlostTrack fires when the face is lostUnlike Image AR, Face AR does not need a recognition image. The "scanning" here is closer to a "please put your face in frame" prompt.
Face AR uses the front camera by default.
If the scene configuration allows camera switching, switchCamera() can still switch to the rear camera; however, the rear camera is usually only suitable when someone else is filming, and is not recommended as the default entry point.
The most commonly used events in a Face AR scene are:
readydownloadAssetProgressloadSceneEndsceneStarttrackedlostTrackerrorAmong them:
sceneStart means the scene has started running and the find-face guidance is showntracked means a face has been detected; the default scan UI hides and photo capture becomes availablelostTrack means a face is not being stably detected in the current frameYou can hide the default scan UI with the hideScan property, then render your own find-face prompt on the host layer.
For example:
await kivicubeIframePlugin.openKivicubeScene(iframe, {
sceneId,
hideScan: true,
});
iframe.addEventListener('tracked', () => {
hideFaceGuide();
});
iframe.addEventListener('lostTrack', () => {
showFaceGuide('Please move your face into frame');
});Custom prompts work better when they are specific, such as "Please face the screen" or "Move to a brighter spot if it is too dark" — these are easier for users to understand than a plain "scanning".
Face AR supports the rotate and scale gestures configured in the scene.
Currently, gestures mainly act on the face content object and do not include a default face-occlusion model. Dragging and tapping are not the primary interaction for Face AR, so it is better to design interactions around:
sceneStart / tracked / lostTrack.tracked has fired at least once, to avoid the user saving a frame where content is not correctly fitted.