Download

Vector Fields without 3rd party apps ?

How would you generate a Vector field for particles in UE4, without resorting to Maya or any other 3D app ?

Thanks.

The fga file format, used for vector fields, is fairly simple. It’s basically a .csv where the final character is a comma. Spaces are ignored. It starts with 3 integers for the field resolution. Then 3 floats each for the bounding box minimum, and the bounding box maximum. Then it’s just a list of floats where every consequent set of 3 is a vector. So the total length of the list is 9+3resolution.xresolution.y*resolution.z

For example, a 128128128 vector field, 100 world units in each dimension, and centered on zero, is 6291465 elements long and looks like:


128, 128, 128,-50.0, -50.0, -50.0, 50.0, 50.0, 50.0, 8.0331274, -1.706719, -3.706719, ...(6291450 elements skipped)...-7.686547, -25.278095, -0.673845,

So you can use whatever you want to generate a string like that. Put it in an fga file and it will import into UE4.

Aye, but typing it all in manually is out of questions :slight_smile:

Apparently Blender has a tool to generate vector fields using Blender’s particle system, so I think I’ve been saved :slight_smile:

Wasn’t talking about typing it manually. You can generate the vectors with for loops in your language of choice. Something like:


    for( k=1; k<=128; k++ )
    for( j=1; j<=128; j++ )
    for( i=1; i<=128; i++ )
    {
    vector=(sin(k^2+j/2),cos(i-j)/k,sin(j)-cos(k^2)/i);
    }

Then it’s just a matter of formatting.