hi guys i need a quick suggestion from you, i'm working on XR simulation of Transformers and i need to show the EMF ( Electromagnetic Field visuals) around the transformer coil. what should i do with that? any suggestion will help, i have tried the SPline but i don;t think it is working as it should be, i need arrows to animate according to show the directiion of flow also. what do you think?
#Electromagnetic Field Visuals around a coil of Transformer? as shown in reference picture
1 messages · Page 1 of 1 (latest)
Have you tried asking AI? Its very good with math related stuff.
Note: this is not relatad to uVS... Stay within topic, and i assume thats what you use
Gemini Suggests
Creating a dynamic electromagnetic field (EMF) visual for an XR simulation requires a blend of math and visual effects.
An efficient way to achieve this is through a Particle System guided by a Vector Field or Mathematical Spline.
Here is a step-by-step logic flow to achieve the animated arrows following the magnetic flux lines:
1. Defining the Magnetic Flux Path
Instead of static splines, you want a mathematical approach so the "flow" is consistent.
The magnetic field \mathbf{B} around a solenoid (transformer coil) can be approximated using the Biot-Savart Law.
The Logic Nodes:
-
Source Point: The center of your coil.
-
Torus/Ellipsoid Equation: Use a parametric equation to define the loop shape.
-
Variable "Lid": Scale these loops based on an index so you get the "onion layer" effect of multiple field lines.
2. Step-by-Step Node Flow
If you are using a tool like Unity VFX Graph, follow this logic:
Phase A: The Path (Emitter Setup)
-
Spawn Rate: Set to a steady stream (e.g., 20 particles per second per line).
-
Initialize Particle: Set lifetime to 2–3 seconds (the time it takes to complete a loop).
-
Custom Vector Attribute: Create a "LineID" to keep particles grouped to specific flux paths.
Phase B: The Motion (Update Loop)
- Sample Spline / Math Function:
-
If using Splines: Use a Sample Spline Position node. Use the particle's Normalized Age (0 to 1) as the input for the spline's distance. This forces the particle to travel the exact path over its life.
-
If using Math: Use a Sine/Cosine node setup to move the particle in an elliptical orbit around the coil core.
- Orientation (The Arrows):
- Node: Orient to Vector or Tangent Path.
- Logic: The "Forward" vector of your arrow mesh should always point toward its velocity. This ensures the arrows look like they are "flowing" through the air.
Phase C: The Visuals (Renderer)
-
Mesh Renderer: Use a simple 3D Arrow Mesh.
-
Dynamic Material: * Use the Particle Relative Time to drive the Opacity.
- Fade the arrows in near the "North" pole and fade them out near the "South" pole to create a seamless loop.
3. Implementation
Summary Table
| Step | Node/Action | Purpose
| 1. Shape | Spline Component | Defines the "rail" for the field lines. |
| 2. Movement | Sample Spline @ Age | Moves the arrow mesh from Start to End over its lifetime. |
| 3. Rotation | Velocity Alignment | Ensures arrows point in the direction of the flux. |
| 4. Animation | Panner / Offset | Animates the texture or spawn rate to show constant motion. |
| 5. Logic | Sine Wave Scalar | Use this to pulse the "intensity" or brightness if the AC current changes. |
4. Pro Tip for XR (Performance)
Since this is for XR (VR/AR), avoid spawning thousands of individual meshes.
-
Use GPU Instancing: Ensure your VFX system is running on the GPU.
-
Ribbon Trails: If the arrows feel too "jittery," add a small Ribbon Trail renderer behind each arrow. This helps the eye track the direction of the electromagnetic flow more easily in a 3D space.
Yes i tried asking AI but it gave me the same solution, but i need to make a visual only not exactly realistic. And also i can’t use the particle system because it would make the application a bit heavy as i m making this for Meta quest 2.
Thanks for the suggestion but i solved it using the Torus shape with shader graph showing arrows and making them animated using time Node. And its worked well and also optimized solution i guess. 🙃
Particle system is not heavy?
Oh shader graph way - thats brilliant!