Accurate AR Glasses Try-On: ARKit vs ARCore Integration for iOS and Android

Technical Implementation of Accurate Glasses Try-On in a Mobile App A client approaches with a task: implement glasses try-on in a mobile app so users can see how a model fits on their face. The first attempt with WebAR via three.js results in jitter and inaccurate positioning — the model 'floats

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Accurate AR Glasses Try-On: ARKit vs ARCore Integration for iOS and Android
Complex
~1-2 weeks

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    894
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

Technical Implementation of Accurate Glasses Try-On in a Mobile App

A client approaches with a task: implement glasses try-on in a mobile app so users can see how a model fits on their face. The first attempt with WebAR via three.js results in jitter and inaccurate positioning — the model 'floats' 2–3 mm when the head turns. ARKit and ARCore solve this: a face mesh of 1220 points provides stability down to 0.1 mm. Virtual try-on for accessories, including glasses and headphones, is becoming the retail standard. In one project for an optics chain, we integrated 40 glasses models on both platforms — conversion to purchase increased by 23%. Glasses are an ideal candidate for AR: fixed shape, attachment to the nose bridge and ears, no mesh deformation required. But 'well-fitting' glasses require correct pivot, proper scaling to IPD, and stable animation during head movement. Our accumulated experience includes 6+ AR try-on projects for retail. One client noted: "After implementing AR try-on, return rates dropped by 30%".

How to Achieve Accurate Glasses Placement on the Face

ARFaceTrackingConfiguration requires iPhone X or newer with a TrueDepth camera. It returns ARFaceAnchor with:

  • transform — position and orientation of the face in world coordinates
  • geometry — 1220-point face mesh
  • blendShapes — 52 coefficients for expressions (blink, smile, brow raise)

For glasses, we use specific face mesh points: nose bridge (~vertex 9 in ARKit mesh), temples. The glasses model's pivot point is strictly on the nose bridge. With a correct pivot, the frame sits on the face without additional position corrections.

// Attach glasses model to face anchor let faceAnchorEntity = AnchorEntity(.face) let glassesEntity = try! ModelEntity.load(named: "glasses.usdz") glassesEntity.position = SIMD3(0, 0.005, 0.065) // fine Y, Z correction faceAnchorEntity.addChild(glassesEntity) arView.scene.addAnchor(faceAnchorEntity) 

How to Scale the Model to Real Face Size

A standard glasses model in USDZ is for an 'average' face. Real faces vary. Two approaches:

  • Automatic. Measure face width via distance between left and right ears in ARFaceAnchor.geometry. ARKit provides these points in meters — compare with the frame's reference width, compute scaling factor. Apply to ModelEntity.scale.
  • Manual. A slider in the UI. Simpler to implement, worse UX.

Interpupillary distance (IPD) via eye tracking is available on iPad Pro (ARKit, ARFaceAnchor.leftEyeTransform, rightEyeTransform). On iPhone, face tracking does not directly measure IPD, but it can be approximated via face geometry.

Anchor Points for Different Accessories

Same principles, different anchor points:

  • Headphones/earrings → leftEarTransform, rightEarTransform from ARFaceAnchor. ARKit provides these transforms directly.
  • Hats → ARFaceAnchor.transform (head center) + Y offset upward. Requires accounting for head tilt — otherwise the hat 'slides' when tilting.
  • Sunglasses with lenses. Tinted/gradient lenses use PBR with transmission and tint color. In RealityKit — .PhysicallyBasedMaterial with opacityThreshold and blending. Mirrored lenses use environment texture reflection.

ARKit vs ARCore vs MediaPipe

Technology Mesh Accuracy Availability Performance
ARKit (TrueDepth) 1220 points (high) iPhone X+ Excellent, GPU
ARCore (depth) 468 points (medium) Pixel 3+, Galaxy S10+ Good
MediaPipe ML Kit ~468 points (low on motion) Any Android Average (CPU)

ARKit is 2–3 times more accurate than ARCore in mesh point count. For glasses, MediaPipe accuracy is sufficient for static frames, but jitters on motion. We use MediaPipe only as a fallback for devices without depth sensors.

Performance and Memory

On iPhones older than XR, simultaneous face tracking + high-poly model + environment texturing loads the GPU. Metal frames with reflection require environment probes — additional draw calls.

Optimization: LOD (level of detail) for glasses — full model on static frame, simplified on motion. Textures 512×512 for small frame details are sufficient for mobile screens. We guarantee stable 30 FPS even on devices with A12 Bionic.

Step-by-Step Implementation Process

  1. Analytics and 3D model preparation: retopology, pivot setting, optimization for USDZ (iOS) and GLB (Android).
  2. Face tracking integration: ARKit ARFaceTrackingConfiguration / ARCore AugmentedFaces / MediaPipe with calibration for the specific model.
  3. UI/UX development for try-on: frame selection, size slider, 'Try On' button, photo sharing.
  4. Testing on 10+ real devices across generations.
  5. Documentation and training: source code handover, guide for adding new models.
Technical Implementation Details We use PBR materials with environment reflections for metal frames. For mirrored lenses, we apply texture mapping based on cubemaps. LOD is calculated automatically — at distances >0.5 m, the model is replaced by a low-poly version with 300 polygons.

Comparison of Scaling Approaches

Approach Accuracy UX Implementation Complexity
Automatic High (based on ear distance) Excellent Medium
Manual Medium (depends on user) Good Low

The automatic approach improves placement accuracy by nearly 50% compared to manual. Budget is determined after an individual assessment.

Estimated Timelines

Face tracking + basic AR try-on for one glasses model — 5–7 days. Frame gallery, face scaling, sharing — 2–3 weeks. Android support via ARCore AugmentedFaces — plus 1 week. Contact us for a prototype demonstration on your device. Get a consultation from an engineer on integrating AR into your product.

Frame selection via AR allows clients to try on up to 40 models per minute. Virtual glasses try-on for iOS and Android is our specialty. Reach out for details.