Skip to content

VBVR-DataFactory/O-15_ball_bounces_given_time_data-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

O-15: Ball Bounces Given Time Data Generator

Generates synthetic tasks where a ball bounces off walls in a bounded area. The goal is to predict and animate the complete trajectory path based on initial position and velocity, stopping after a specified number of bounces.

Each sample pairs a task (first frame + prompt describing what needs to happen) with its ground truth solution (final frame showing the result + video demonstrating how to achieve it). This structure enables both model evaluation and training.


📌 Basic Information

Property Value
Task ID O-15
Task Ball Bounces Given Time
Category Knowledge
Resolution 1024×1024 px
FPS 16 fps
Duration ~5 seconds
Output PNG images + MP4 video

🚀 Usage

Installation

# Clone the repository
git clone https://github.com/VBVR-DataFactory/O-15_ball_bounces_given_time_data-generator.git
cd O-15_ball_bounces_given_time_data-generator

# Install dependencies
pip install -r requirements.txt

Generate Data

# Generate 100 samples
python examples/generate.py --num-samples 100

# Generate with specific seed
python examples/generate.py --num-samples 100 --seed 42

# Generate without videos
python examples/generate.py --num-samples 100 --no-videos

# Custom output directory
python examples/generate.py --num-samples 100 --output data/my_output

Command-Line Options

Argument Type Description Default
--num-samples int Number of samples to generate 100
--seed int Random seed for reproducibility Random
--output str Output directory data
--no-videos flag Skip video generation False

📖 Task Example

Prompt

A ball is placed at the initial position with a direction arrow indicating its movement direction. Simulate the ball bouncing 4 times off the boundary walls following elastic collision physics (angle of incidence equals angle of reflection). The ball stops after the 4th bounce, with its final position at the wall where the last collision occurs.

Visual

Initial Frame
Ball with direction arrow
Animation
Ball bounces off walls along trajectory
Final Frame
Ball stops at wall after Nth bounce

📖 Task Description

Objective

Predict and animate the trajectory of a ball bouncing off walls in a bounded rectangular area, stopping after a specified number of bounces.

Task Setup

  • Bounded Area: Rectangular region with four walls
  • Initial State: Ball at starting position with direction arrow indicating movement direction
  • Bounce Count: Specified number of bounces (typically 2-6)
  • Physics: Elastic collisions with walls (angle of incidence = angle of reflection)
  • Stopping Condition: Ball stops immediately after the Nth bounce, final position at the collision wall

Key Features

  • Trajectory prediction: Tests understanding of ball motion and bouncing physics
  • Elastic collision: Angle of incidence equals angle of reflection at walls
  • Multi-bounce simulation: Ball bounces multiple times off different walls
  • Velocity preservation: Ball maintains speed (elastic collisions)
  • Stopping criterion: Ball stops at wall after exact number of bounces
  • Path visualization: Complete trajectory path shown in animation
  • Visual variety: 20 distinct ball colors for diverse visual appearance

📦 Data Format

data/questions/ball_bounces_given_time_task/ball_bounces_given_time_00000000/
├── first_frame.png      # Initial state (ball with direction arrow)
├── final_frame.png      # Final state (ball after specified bounces)
├── prompt.txt           # Task instructions
├── ground_truth.mp4     # Solution video (16 fps, H.264)
└── question_metadata.json # Task metadata

File specifications: Images are 1024×1024 PNG. Videos are MP4 at 16 fps, approximately 5 seconds long.


🏷️ Tags

physics-simulation trajectory-prediction bouncing-ball elastic-collision multi-bounce path-prediction kinematics


About

Ball bouncing physics trajectory prediction data generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages