Particle Animation Replication: An Engineering Evaluation of AI Coding Capabilities
This article examines particle animation replication as a practical way to evaluate AI coding systems beyond surface-level demos. It outlines how to turn a visual goal into executable specifications, collect browser-based evidence, decompose the effect into particle, formation, and interaction systems, use scroll progress as state, add pointer perturbation safely, measure performance, and assess results through visual, dynamic, engineering, and iteration criteria. The goal is a repeatable, evidence-based evaluation rather than a judgment based on a single screenshot or first impression.
1. Generating an Animation Is Not the Same as Reproducing It Accurately
Visual effect development is one of the easiest areas to misjudge when evaluating AI coding capabilities.
Suppose the same request asks for a demo page where particles gather and disperse as the page scrolls, then form a specified pattern. Different implementations may all run and look reasonably attractive, but the gap between each one and the reference effect can be obvious. Some patterns have inaccurate outlines. Some particle motion lacks depth. Some perform only a single simple transformation and fail to reproduce the rhythm and spatial sense of the scroll process.
The real test in this kind of task is not whether the system can write a particle animation. It is whether the system can translate a visual target into a measurable, implementable, and verifiable engineering problem.
It is important to be clear that without complete reference materials, a runtime environment, and unified test records, an initial version alone cannot be used to rank the overall capability of AI coding systems. A more reliable approach is to build an evaluation framework around the same task and observe the full process: how evidence is obtained, how the problem is decomposed, how the implementation is completed, and how deviations are corrected.
2. Turn “Looks the Same” into Executable Requirements
“Make it as close to the reference page as possible” expresses a goal but does not define implementation boundaries. In engineering practice, a visual and interaction specification should be established first.
2.1 Define Static Visual Features
For a spiral-galaxy-style particle effect, at least the following should be recorded:
- The position and proportion of the particle body within the viewport;
- The density difference between the central area and the outer area;
- The number of spiral arms, their curvature trend, and density variation;
- Particle size, brightness, opacity, and color distribution;
- Background color, glow range, and overall contrast;
- The outline, orientation, and negative space of each target pattern.
The point here is not to fill in precise values for every property immediately. It is to avoid compressing visual features into a single phrase such as “small dots like stars.”
For example, a uniformly scattered point cloud and a cloud that is dense at the center and sparse at the edges can use the same color yet produce completely different spatial impressions. The latter needs to be achieved through sampling distribution and brightness layering together, not simply by increasing the particle count.
2.2 Define Dynamic Behavior
The dynamic specification should cover the full time process:
- What state the particles are in when the page first loads;
- At which scroll interval the change begins;
- Whether the particles first disperse and then gather, or transition directly from one pattern to another;
- Whether gathering is accompanied by rotation, scaling, or depth-of-field changes;
- Whether the scene continues to move slowly after scrolling stops;
- Whether the animation can rewind continuously when scrolling in reverse;
- How particles affected by the pointer recover after the pointer leaves the canvas.
If these behaviors are not defined in advance, the implementer will often fill in details according to their own aesthetic sense. The result may be a good new animation, but not an accurate replication.
2.3 Define Delivery Boundaries
A standalone demo page should also specify resource usage, supported environments, startup method, and degradation requirements. For example: Are external resource requests allowed? Must touch devices be supported? Must it run without a network connection?
When a reference page is involved, legal authorization and usage boundaries must come first. Being able to access code or assets through a browser does not mean one may directly copy or redistribute source code, fonts, graphic marks, or other protected content. A safer route is usually to analyze publicly visible behavior, independently implement the general motion mechanism, and use assets that are owned or properly licensed.
3. Browser Observation Should Produce Evidence, Not Mechanical Screenshots
For web animations, directly observing the browser output is usually more effective than relying only on text descriptions. But “opening the page” is only the beginning. The important part is building systematic observation records.
3.1 Capture Key States by Scroll Progress
The effective scroll interval can be normalized to a progress value between zero and one. Record the starting state, the midpoint of the form transition, the formation of the target pattern, and the ending state.
These records should ideally include:
- Viewport size and display scaling;
- Page scroll position;
- The bounding range of the pattern;
- The degree of particle aggregation;
- Pointer position;
- Whether the scene is in a stable state after scrolling stops.
A single screenshot shows only the appearance at one instant and cannot reveal the motion path. It is therefore necessary to observe the continuous process and distinguish different mechanisms such as “particles moving,” “camera moving,” and “the whole container transforming.”
3.2 Separate Observed Facts from Technical Inferences
Seeing that particles have a three-dimensional feel does not prove that true 3D rendering is being used. 2D coordinates plus size and opacity changes based on depth can also produce a similar effect.
Engineering records should clearly distinguish:
- Facts that have been observed;
- Hypotheses proposed to explain visual phenomena;
- Implementation approaches to be used.
This distinction prevents a common problem: investing significant development time around an incorrect assumption before the underlying mechanism has been verified.
3.3 Choose Tools That Serve the Task
If browser inspection is already sufficient to obtain information about the rendered scene, scroll state, and resource loading, there is no need to force a full desktop interaction simulation just to demonstrate operational capability.
Tool selection is itself part of engineering capability. The reasonable standard is whether reliable evidence can be obtained at low cost, not whether the operation steps are complex.
4. Decompose the Effect into Particles, Formations, and Interaction
A maintainable implementation should not pile all logic into a single animation loop. A clearer approach is to separate basic particle data, target formation generation, and interaction control.
4.1 Keep Particle Base Data Stable
Each particle can have the following base attributes:
- A fixed ID;
- Base size and brightness;
- A random seed for perturbation;
- Target coordinates for each formation;
- Current display position or interaction offset.
Random data should be generated during initialization as much as possible and reused in later frames. If random targets are regenerated every frame, particles will flicker and jump, and stable transitions between multiple formations will be impossible.
When experimental results need to be reproduced, a fixed-seed pseudorandom generation process can also be used so that the same input produces the same point cloud.
4.2 Generate Galaxy Formations Through Parametric Sampling
A spiral structure can be described in polar coordinates. Let the radius from the center be r and the angle be θ. We can construct:
θ = k·r + φ + ε
Here, k controls the degree of winding, φ represents the phase offset of different spiral arms, and ε represents a small angular perturbation. Then convert to planar coordinates:
x = r·cosθ
y = r·sinθ
By assigning each particle a certain offset in the thickness direction, a point cloud with depth can be formed.
This is only a modeling starting point, not a claim that any reference effect fits this formula. The actual appearance also depends on radius distribution, spiral arm width, center density, viewing angle, and brightness mapping. In particular, uniform sampling in radius is not the same as uniform sampling in area; the distribution should be chosen according to the target density.
4.3 Generate Target Point Sets Separately for Specified Patterns
Digits, symbols, or an owned logo can first be converted into outlines or grayscale masks, and then target positions can be sampled from the valid area.
The sampling method affects the final texture:
- Sampling inside the area suits patterns with a stronger solid feel;
- Sampling along the outline emphasizes the boundary;
- Grayscale-weighted sampling can preserve light and dark layers;
- Setting a minimum point spacing helps reduce excessive local clustering.
Different formations should preferably have the same number of particles. If there are too few points, they can be filled in by repeated sampling with slight offsets. If there are too many, spatially representative sampling should be used rather than simply taking the first subset.
4.4 Particle Mapping Determines Whether Deformation Looks Natural
Assume both formations contain the same number of points. If correspondences are established directly by random IDs, the deformation may produce many crossing motions and a messy “streaking” effect.
Depending on particle scale and development cost, the following methods can improve mapping:
- Match after sorting by polar angle and radius;
- Divide space into grid regions and match within regions;
- Use approximate nearest-neighbor matching to reduce total displacement;
- First transition particles to an intermediate dispersed state, then enter the target pattern.
Not every animation should minimize displacement. If the reference effect emphasizes an explosive burst, larger motion paths may be appropriate. The mapping strategy should serve the visual goal rather than simply pursuing the mathematically shortest path.
5. Organize State with Scroll Progress, Not Stacked Triggers
The most common problem in scroll-driven animation is code filled with conditions such as “when scrolling passes a certain point, play a certain animation segment.” This style easily leads to discontinuous reverse scrolling and corrupted state after fast dragging.
A more reliable method is to calculate the visual state directly from the current scroll progress.
Let the start and end scroll positions of an animation segment be a and b, and let the current scroll position be s. The local progress is:
t = clamp((s - a) / (b - a), 0, 1)
Then apply a smooth interpolation function:
u = t²·(3 - 2t)
When particles transition from start point A to end point B:
P = (1 - u)·A + u·B
If the effect needs to disperse first and then gather, calculate the transformations for “A to dispersed state” and “dispersed state to B” in two intervals instead of performing only one linear interpolation between the start and end points.
This design has three advantages: any scroll position corresponds to a deterministic frame; reverse scrolling works naturally; and screenshot regression tests are easier to reproduce.
The base formation should preferably remain directly evaluable. If inertia-following or spring effects are added, they should be treated as an independent layer, and automated screenshots should wait for stabilization to avoid test results being affected by the historical scroll path.
6. Treat Pointer Interaction as a Local Perturbation Layer
Pointer repulsion or attraction should not directly destroy the particles’ target coordinates. Otherwise, the pattern may fail to recover after the mouse moves.
A more reasonable expression is:
Final position = current formation position + ambient micro-motion + pointer perturbation
For particles close to the pointer, a falloff weight can be calculated based on distance. For example, let the influence radius be R and the distance from the particle to the pointer be d:
w = max(0, 1 - d / R)²
Then apply displacement away from or toward the pointer. When calculating direction, protect against extremely small distances to avoid division by zero or numerical instability.
If particles are in 3D space, conversion between screen coordinates and scene coordinates must also be handled. Subtracting scene coordinates directly from screen pixels usually causes the influence range to change with viewport size, or makes the pointer appear not to align with the affected area.
Touch devices do not have a persistent hover state, so a different strategy should be used. For example, respond only to touch position, or preserve the scroll-driven main effect without forcing a simulation of desktop interaction.
7. Base Performance Optimization on Measurement
Whether a particle animation is smooth cannot be judged only by subjective experience on a development device. The costs of processor computation, graphics rendering, memory allocation, and page layout should be observed separately.
7.1 Choose the Rendering Method by Scale
When there are few particles and formations are simple, a 2D canvas may be sufficient. As particle count, blending effects, or 3D transformation complexity increase, hardware-accelerated graphics rendering can be considered.
It is not advisable to create a page element for every particle in a large particle system, because this may introduce extra style calculation, layout, and painting costs.
7.2 Avoid Per-Frame Object Allocation
Repeatedly creating arrays, coordinate objects, or color objects inside the animation loop can increase memory reclamation pressure. A safer approach is to preallocate contiguous buffers and update only the necessary data.
Window size measurement, resource parsing, and target point sampling should also be moved out of the per-frame path as much as possible.
7.3 Control the Actual Number of Drawn Pixels
High-pixel-density screens significantly increase rendering load. The rendering resolution does not need to follow the device’s maximum pixel density unconditionally; an upper limit can be set according to the quality target.
When many semi-transparent particles overlap, repeated pixel shading can also become a bottleneck. Therefore, “reducing the particle count” is not the only optimization method. Reducing the area covered by particles and controlling the glow range are equally important.
7.4 Provide Adaptation and Degradation
When the page is not visible, unnecessary updates can be paused. When the user prefers reduced motion, continuous rotation and strong displacement should be reduced, or a static alternative should be provided.
For ordinary page presentation, stability, clarity, and accessibility are often more valuable than stacking more particles.
8. How to Objectively Evaluate AI Coding Quality
A complete evaluation should consider both the result and the process, rather than showing only a screenshot of the final effect.
8.1 Visual Consistency
Under the same viewport, same scroll progress, and same interaction conditions, compare the main outline, density, color, negative space, and spatial layering. Pixel differences can only serve as a secondary signal, because slight random particle offsets may produce large differences without necessarily indicating a drop in perceived quality.
8.2 Dynamic Consistency
Check the transition order, gather-disperse rhythm, motion paths, reverse scrolling, and rapid jumps. An implementation that looks close in a static screenshot may still show obvious deviations during continuous motion.
8.3 Engineering Completeness
Confirm whether the demo page can start independently, whether resources are complete, whether there are console errors, whether it behaves correctly after size changes, and whether memory continues to grow during long-running use.
8.4 Iteration Capability
Record the problems in the initial version, the proposed corrections, and the result of each round of changes. A strong AI coding process should be able to state “where it does not match, why it does not match, and how the fix will be verified,” rather than repeatedly changing colors and adding particles without explaining the source of the error.
If multiple systems are compared, the prompt materials, tool permissions, time budget, and feedback rounds should also be standardized, and the degree of human intervention should be recorded. Otherwise, apparent capability differences may simply reflect different input conditions.
9. Conclusion: Real Capability Shows in the Closed Loop
Particle animation replication may look like a front-end visual task, but it actually spans requirements analysis, graphics modeling, interaction design, performance engineering, and test verification.
A reliable implementation process should follow a closed loop: observation and evidence collection, specification decomposition, minimal prototype, visual calibration, performance testing, and regression acceptance. Ensuring that form and timing logic are correct first, then adding glow, micro-motion, and interaction details, is usually more effective than pursuing a flashy effect from the start.
Evaluating AI coding capability should follow the same logic: do not substitute novelty for evidence, do not substitute first-version appearance for complete delivery, and do not infer conclusions for all scenarios from one task. The truly valuable capability is the ability to continuously converge a vague goal into a stable, explainable, and maintainable engineering result.
