A simple AR app built with React Native and ViroReact. You can load 3D models, move them, resize them, and trigger animations. It also supports marker-based AR using reference images.
-
Custom 3D models and textures.
-
Animations attached to models.
-
Object interaction:
- Drag to reposition.
- Pinch to scale.
-
Marker-based AR using a reference image.
-
Runs on a physical Android or iOS device.
You need:
- A physical smartphone. AR will not work on emulators.
- React Native environment setup: https://reactnative.dev/docs/environment-setup
- Node.js and npm installed.
-
Clone the repo:
git clone <your-repository-link> cd <project-folder>
-
Install dependencies:
npm install
-
iOS only: install CocoaPods:
cd ios pod install cd ..
-
Start the Metro bundler:
npm start
-
Connect your phone with USB and run:
Platform Command Android npx react-native run-androidiOS npx react-native run-ios
If setup is correct, the AR scene will load on your phone.
Main AR logic is inside:
App.tsx
To test code changes:
- Android: Press R key twice in Metro terminal.
- iOS: Shake device and select Reload.
project/
├── ios/
├── android/
├── src/
│ ├── scenes/ # AR scenes
│ ├── assets/ # Models, textures, markers
│ └── App.tsx
└── package.json
Place models and textures under:
src/assets/
Supported formats:
- .obj with .mtl for textures
- .glb or .gltf
If you add new assets, update imports inside the AR scene.
Reference image files go into:
src/assets/markers/
Update marker paths in AR scene code. Use clear, high-contrast images for better detection.
- If nothing appears: check device permissions for camera.
- If the app fails to install: confirm Android SDK or iOS setup.
- If models appear tiny or huge: adjust scale property in code.
React Native setup: https://reactnative.dev/docs/environment-setup
ViroReact documentation: https://viro-community.readme.io/