Building a web AR menu: from dish photos to a 3D model on the table
I'm building AR Menus , an AR menu for restaurants: diners scan a QR code and can place any dish on their table in augmented reality, straight from the browser. Here is how the pieces fit. Stack Menu app: React 18 + Vite PWA, @google/model-viewer for 3D and AR, three under the hood Dashboard: React + MUI, where restaurants upload dish photos API: Flask + Celery workers, PostgreSQL (Supabase),…
Building an augmented reality (AR) menu for restaurants involves transforming dish photos into 3D models that customers can place on their tables using their smartphones. The process starts when a restaurant uploads a few images of a dish to a backend system. An image-to-3D service then converts these photos into a textured 3D model, which is exported into GLB format for Android/WebXR and USDZ for iPhone.
After generation, the model's geometry and textures are compressed to ensure the file size remains manageable. Once the model is ready, it's stored alongside the dish information, and a "View in AR" button appears on the menu only after the model has loaded. This prevents users from attempting to view an AR scene with an unloaded model, which would result in a failed experience.
Several factors are crucial for a successful AR menu. Firstly, file size is more important than polygon count, as smaller files load faster on slow Wi-Fi connections commonly found in restaurants. Secondly, real-world scale is essential; a model that's too large or too small will appear unrealistic, such as a burger looking like a cake. Therefore, scale is checked for every dish before it's displayed.
Another crucial aspect is lighting. A neutral studio HDR lighting setup ensures dishes look appetizing rather than looking plastic. The final component is ensuring compatibility with different devices and browsers. The menu uses WebXR on Chrome Android first and Scene Viewer as a fallback, with Quick Look as an option for iOS users. This approach accommodates the varying AR capabilities of different phones, providing a seamless experience for all customers.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to