Self-attention Mechanism Improves Object Interaction in 3D Animation Scenes
摘要
The object interaction in current 3D animation scenes is often limited by the low computational efficiency and insufficient dynamic adaptability of traditional physical simulation or rule-driven methods, especially in the case of complex multi-object interactions, which makes it difficult to balance authenticity and real-time performance. This study proposes a dynamic interaction model based on the self-attention mechanism. First, a feature tensor containing object position, velocity, and material properties is constructed, and spatiotemporal features are extracted through a hierarchical Transformer encoder; secondly, a multi-head self-attention module (8 heads, 512-dimensional key-value pairs) is designed to capture long-range dependencies across objects, and gradient propagation is optimized by combining residual connections and layer normalization; then, a reinforcement learning framework (PPO algorithm, learning rate 2e-5) is used to train interaction strategies in the Unity3D environment, and end-to-end optimization is achieved through a 64-channel interaction reward function (including collision probability, energy conservation, and motion coherence indicators). Experiments show that in a dynamic scene with more than 200 objects, the average F1-score of this model in the interaction accuracy test is 0.898, and the average inference speed is 24.4 ms. Through behavioral data analysis and eye tracking indicators, the interaction effect is in line with human cognitive expectations. This method effectively solves the real-time modeling problem of multi-scale object interaction in complex animation scenes and provides an efficient solution for 3D content generation.