Inspiration
Physics teachers often struggle to show abstract laws using only static drawings on a whiteboard. Good interactive simulations take too much time to build, and cloud-only AI tools fail in classrooms with slow or no internet. We wanted to give teachers a fast, reliable way to create live physics demonstrations on any device, even offline.
What it does
Physica turns text prompts and textbook problems into interactive, physics-aware 3D simulations for the classroom. Teachers can describe a physics scenario, like projectile motion, pendulums, or collision, and adjust variables like gravity, mass, and velocity in real time. Using hybrid AI, routine updates and local simulations run instantly on the user's device without internet, while complex lesson generation uses cloud AI when connected.
How we built it
We built the interactive 3D engine using Three.js and WebGL so simulations run smoothly right in the browser. To solve the connectivity and latency problem, we used the Firebase AI Logic Hybrid Inference SDK:
- On-Device AI: Runs fast parameter tweaks, equation checks, and offline classroom interactions locally using Gemini Nano (and Apple Foundation Models on iOS).
- Cloud Fallback: Automatically switches to cloud models when generating complex multi-step physics scenes or when a device lacks local model support.
- Firebase Ecosystem: We integrated Firebase Authentication for teacher accounts and Cloud Firestore to save custom classroom simulations.
Challenges we ran into
Designing a smooth handoff between on-device models and cloud models was our biggest challenge. Local models have smaller context windows and can struggle with complex 3D scene code, while cloud models add network delay. We solved this by splitting tasks: keeping offline classroom AI assistance on-device, and keeping heavy scene generation to the cloud.
Accomplishments that we're proud of
- Building a complete, zero-latency 3D physics tool that works offline.
- Achieving seamless hybrid routing with one unified Firebase AI Logic codebase across platforms.
- Cutting cloud API costs by handling AI assistance locally on the device.
What we learned
We learned that hybrid AI works best when you match the task to the right model. On-device AI assistance helps for occasional assistance and privacy, while keeping Firebase's cloud and Remote Config for generating course materials.
What's next for physica
Next, we plan to add real-time multi-student classroom sessions using Cloud Firestore, expand our library to other subjects other than physics, and let teachers export APK simulations with android native functionalities.