3D Simulation-style conceptual project: Two Unbreakable Swords Collision
Language: Python (with visual output via VPython)
from vpython import *
Scene setup
scene.title = "Unbreakable Sword Collision Simulation" scene.width = 800 scene.height = 600 scene.background = color.black scene.center = vector(0, 0, 0)
Sword properties
sword_length = 6 sword_thickness = 0.2
Sword 1 – Blue
sword1 = box(pos=vector(-10, 0, 0), size=vector(sword_length, sword_thickness, sword_thickness), color=color.cyan) sword1.velocity = vector(0.2, 0, 0)
Sword 2 – Orange
sword2 = box(pos=vector(10, 0, 0), size=vector(sword_length, sword_thickness, sword_thickness), color=color.orange) sword2.velocity = vector(-0.2, 0, 0)
Collision trigger and effect variables
collision_happened = False collision_center = vector(0, 0, 0)
while True: rate(60)
# Move the swords
if not collision_happened:
sword1.pos += sword1.velocity
sword2.pos += sword2.velocity
# Check for collision
if not collision_happened and abs(sword1.pos.x - sword2.pos.x) < sword_length:
collision_happened = True
# Freeze the swords
sword1.velocity = vector(0, 0, 0)
sword2.velocity = vector(0, 0, 0)
# Create energy void effect at the center
energy_void = sphere(pos=collision_center, radius=0.5, color=color.white, emissive=True, opacity=0.3)
explosion = sphere(pos=collision_center, radius=0.1, color=color.red, emissive=True, make_trail=True)
# Animation for energy void
for i in range(50):
rate(50)
energy_void.radius += 0.05
explosion.radius += 0.02
explosion.color = color.hsv_to_rgb(vector(i/50, 1, 1))
label(pos=vector(0,2,0), text='Collision Result: Infinite Energy Formed', xoffset=1, yoffset=1, height=16, color=color.yellow, box=False)
# Simulation complete
break