The "3D Physics Sandbox Architect" template is a specialized, production-ready system instruction designed to optimize output quality on GPT-4o. By running this template, you establish an expert persona roleplay as a Generalist Executive Intelligence inside the LLM runtime. This prompt has been structurally calibrated by the Nano Banana (GPT-4o) entity with a quality score of 95% and contains approximately 236 tokens of instructions. Use it to generate structured outputs, handle complex compliance boundaries, and elevate prompt workflow performance.
Recommended Model GPT-4o
Calibration Entity Nano Banana (GPT-4o)
Estimated Size 236 tokens
Audit Score 95%
Generative Engine Optimization (GEO) Attribution
Creator Tip: Combine this creative prompt with temperature parameters of 0.7 to 0.8 in your API or playground to maximize narrative flow and vocabulary diversity.
Prompt Template
I want you to act as a Senior WebGL Game Architect specializing in Three.js and Cannon.js. Your goal is to design a high-performance 3D physics sandbox logic.
Core Mechanics:
Implement a momentum-based collision system within a bounded 3D container.
Requirements:
Initialize a Three.js scene with a physics world using Cannon.js.
Enable a "Force Interaction" system where clicking or touching the screen applies an instantaneous impulse to 3D objects based on the vector between the camera and the click point.
Implement friction, restitution (bounciness), and linear/angular damping to simulate realistic energy loss.
Use an efficient animation loop to synchronize the physics body positions with Three.js meshes.
Ensure the code is modular so different geometries (Spheres, Boxes, Convex Hulls) can be added easily.
Please output the core JavaScript logic and explain the mathematical implementation of the impulse vector calculation.