A WPF application that renders text as 3D geometry and bounces it inside a translucent cube.
Enter any text and watch it come alive as a 3D object bouncing around inside a translucent cube. The application offers three control modes to suit your preference:
- Automatic — Physics-based animation with realistic bouncing and rotation
- User — Direct control over position and orientation via sliders
- Mixed — Physics simulation with user-defined offsets
- 3D Text Rendering — Text is converted to extruded 3D geometry using WPF's
FormattedTextAPI - Physics Simulation — Velocity, collision detection, and angular momentum
- Rendering Modes — Choose between solid fill, wireframe, or point cloud visualization
- Real-time Controls — Adjust position, rotation, speed, and more while the simulation runs
- Smooth Animation — Frame-synchronized rendering via
CompositionTarget.Rendering
# Build and run
dotnet run --project src/3dBouncer.csproj
# Or use the solution
dotnet run --project src/3dBouncer.slnRequires .NET 8.0 SDK and Windows.
| Control | Description |
|---|---|
| Text Input | Enter text to render (click "Bounce!" to apply) |
| Change Color | Randomize the text color |
| Speed Slider | Animation speed (0.1x to 10x) |
| Position (X/Y/Z) | Translate the text along each axis |
| Rotation (Pitch/Roll/Yaw) | Rotate the text around each axis |
| Triangle Size | Subdivision level for mesh quality |
| Point Count | Number of points in point cloud mode |
| Point Size | Size of points in point cloud mode |
- Solid Fill — Extruded text with smooth shading
- Wireframe — Cyan mesh showing the underlying geometry
- Point Cloud — Scattered points across the text surface
- Automatic — Pure physics: the text bounces off cube walls with velocity damping
- User — Sliders directly control position and rotation
- Mixed — Physics simulation runs, but user offsets are added to the result
src/
├── 3dBouncer.csproj # Project file with HelixToolkit.Wpf dependency
├── 3dBouncer.sln # Solution file
├── App.xaml # Application entry point
├── MainWindow.xaml # UI layout with HelixViewport3D
├── MainWindow.xaml.cs # All application logic
└── styles.xaml # UI resource dictionary
- Text Triangulation — Uses ear clipping algorithm with hole detection via WPF's
CombinedGeometry - Animation Loop —
CompositionTarget.Renderingsyncs with display refresh rate - Physics — Simple bounds checking with configurable damping factors
- Rotation — Quaternions via
CreateQuaternionFromEulerAnglesfor smooth 3D rotation
MIT