How cortofanchic/useevtubing works
1. What this repo is
- An Android VTubing app for real-time avatar animation from the device camera.
- It is a mixed Kotlin + NDK/C++ project: Kotlin owns the app/UI flow, while native C++ handles 3D model/VRM processing and rendering-related work.
2. Top-level app shape
- The app is centered in app/ and runs on Android API 26+.
- The entry point is MainActivity.kt, with a single app shell hosting multiple screens rather than a server/client split.
- activity_main.xml exists, so the UI is likely hosted through the Android activity layer with screen navigation inside the app.
3. Primary user-flow screens
- screens/WelcomeScreen.kt introduces the app.
- screens/CharacterScreen.kt is the model setup boundary where the user loads a .vrm avatar.
- screens/CameraScreen.kt is the runtime animation screen where the camera feed drives the avatar.
- screens/GalleryScreen.kt likely manages browsing/selecting saved avatars or captured media.
4. Core runtime data flow
- User selects a VRM avatar in the character flow.
- The app converts/loads that model into a renderable format.
- The camera screen captures live video, extracts motion/face signals, and forwards those signals to the avatar renderer.
- The renderer updates the 3D model frame-by-frame and displays the animated VTuber avatar back to the user.
5. Camera + tracking subsystem
- The README states the app uses ML Kit for pose tracking (33 landmarks) and face tracking.
- This implies a real-time pipeline: camera frames → ML inference → pose/face state → avatar rig/animation input.
- The app supports front and back cameras and mirroring, so camera orientation is part of the runtime state.
6. 3D model / rendering subsystem
- ModelRenderer.kt is the Kotlin-side rendering bridge.
- app/src/main/cpp/native-lib.cpp plus CMakeLists.txt indicate a native shared library is built for model handling and rendering support.
- Native dependencies under app/src/main/cpp/libs/ include VRM.h, fx-gltf, and json, which strongly suggests VRM/glTF parsing and conversion happen in native code.
- The README specifically mentions VRM support with automatic GLB conversion, so model ingestion is a dedicated boundary, not just a UI concern.
7. Persistence and media handling
- The README says loaded avatars are saved between launches, so there is some app-level persistence for the chosen model.
- The app also supports photo capture and video recording from the camera screen, so media output is part of the runtime path and likely tied to Android storage/media permissions.
- Required permissions are CAMERA plus external storage access, indicating direct device I/O rather than cloud storage.
8. Android framework boundaries
- This project depends on Android platform services for:
- camera access,
- storage/media access,
- app lifecycle and activity hosting,
- resource/theme management.
- There is no sign of a backend service or network API in the tree, so the architecture appears fully local/on-device.
9. UI organization and shared app state
- ui/theme/ contains color, typography, and theme definitions, suggesting the screens share a consistent styled shell.
- utils/BottomNavItemModel.kt and utils/Constants.kt indicate shared navigation and configuration state, probably used to wire the main screen navigation and app-level settings.
10. Repository layout and build boundaries
- app/build.gradle.kts and gradle/libs.versions.toml define the Android build and dependency versions.
- The NDK build is isolated under app/src/main/cpp/, which is the main boundary between Kotlin app logic and native 3D/model processing.
- Tests are split into standard Android instrumentation tests and local unit tests, but they are peripheral to the runtime architecture.
11. What to draw in an architecture diagram
- A good diagram should show:
- User/UI layer: welcome, character, gallery, camera screens
- Camera + ML layer: Android camera input and ML Kit pose/face tracking
- Avatar/model layer: VRM loading, conversion, persistence
- Native rendering layer: C++/NDK, fx-gltf/json/VRM support
- Output layer: on-screen animated avatar plus photo/video capture
- The key flow is camera input and model input converge into the renderer, with Kotlin coordinating the app experience and C++ doing the heavy 3D work.
Main entry points: MainActivity.kt Main Activity · CameraScreen.kt Camera · CharacterScreen.kt Character · native-lib.cpp native-lib
Components 16
Android app
Kotlin app layer, screens, and shared UI state
- Main Activity · Hosts the app shell and screen navigation
app/src/main/java/com/example/useevtubingapp/MainActivity.kt - Welcome · Entry screen that introduces the app
app/src/main/java/com/example/useevtubingapp/screens/WelcomScreen.kt - Character · Loads and prepares the user's VRM model
app/src/main/java/com/example/useevtubingapp/screens/CharacterScreen.kt - Camera · Live camera-driven avatar animation and capture
app/src/main/java/com/example/useevtubingapp/screens/CameraScreen.kt - Gallery · Browses saved avatars or captured media
app/src/main/java/com/example/useevtubingapp/screens/GalleryScreen.kt - Model Renderer · Kotlin-side bridge into native model rendering
app/src/main/java/com/example/useevtubingapp/ModelRenderer.kt - Tracking · Camera frames are analyzed for pose and face signals
- Capture · Takes photos and records video from the camera flow
- Avatar state · Stores the selected avatar between launches
app/src/main/java/com/example/useevtubingapp/utils/Constants.kt - Nav state · Bottom navigation and app-level constants
app/src/main/java/com/example/useevtubingapp/utils/BottomNavItemModel.kt - Theme · Shared colors, typography, and theme setup
app/src/main/java/com/example/useevtubingapp/ui/theme/Theme.kt
Native 3D
NDK/C++ model ingestion and rendering support
- native-lib · JNI entry point for native model handling
app/src/main/cpp/native-lib.cpp - VRM libs · VRM, glTF, and JSON support for model ingestion
app/src/main/cpp/libs/VRM.h - CMake · Builds the shared native library and dependencies
app/src/main/cpp/CMakeLists.txt
Platform
Android manifest, resources, and host shell
- Activity layout · Host layout for the main activity shell
app/src/main/res/layout/activity_main.xml - Manifest · Declares the app entry, permissions, and platform wiring
app/src/main/AndroidManifest.xml
Connections 18
- Manifest → Main Activity: launches · Android starts the main activity from the manifest
- Main Activity → Activity layout: hosts · The activity uses the main layout as its shell
- Main Activity → Welcome: navigates to · Initial app flow begins on the welcome screen
- Main Activity → Character: navigates to · User moves into avatar setup
- Main Activity → Camera: navigates to · Main runtime screen for tracking and rendering
- Main Activity → Gallery: navigates to · Provides access to saved media and avatars
- Camera → Tracking: feeds frames · Camera input is analyzed for pose and face state
- Tracking → Model Renderer: drives avatar · Tracking output updates the animated model
- Character → Avatar state: stores model · Selected avatar is persisted for later launches
- Avatar state → Camera: restores model · Runtime screen reuses the saved avatar
- Character → Model Renderer: loads VRM · Model setup hands the chosen avatar to rendering
- Model Renderer → native-lib: JNI bridge · Kotlin rendering calls cross into native code
- native-lib → VRM libs: parses models · Native code uses VRM/glTF/JSON support for ingestion
- native-lib → CMake: built by · CMake builds the native shared library
- Camera → Capture: captures media · The runtime screen supports photos and video recording
- Gallery → Capture: browses output · Gallery presents captured media or saved assets
- Main Activity → Nav state: uses · Shared navigation configuration wires the app shell
- Main Activity → Theme: applies · App-wide styling is provided through the shared theme