• Hey! Register here to create your account, engage with the community, and talk about what is new!

I'm struggling to find ways to get a particle line in like an arc or curved line, is there any way to do this?

mitsuki

New member
Joined
Sep 2, 2021
Messages
5
Reaction score
1
I'm kind of set on it being without having to brute force a bunch of locations that replicate what the curve could look like as I would have to redo huge lines of code for ever time I need it. I've tried doing things like selecting only certain locations from a repeat on sphere, to take its curve, but naturally that has its problems and limitations on any variety of curve. I'm sure I've seen people successfully do this before but I'm lost on where to look. plz help
 
Solution
If you want an arc, you can try rotating a location around an axis in a loop for a certain amount of times.

How you would go about doing this is to have a location origin, vector axis, and a vector that is the vector to the particle, as well as an auxiliary location for the actual particle location.

Here's an example pseudocode:
C-like:
// some starting values that will define our arc

pfx = (whatever particle)

origin = Location (25.5, 51.5, 25.5)
axis = Vector (0, 1, 0)
vec = Vector (3, 0, 0)
degrees = Number 90

// drawing the arc

repeat Multiple(degrees) {
    pos = ShiftOnVector(origin, vec)
    DisplayParticle(pfx, pos)
    vec = RotateVectorAroundVector(vec, axis, -1) // -1, because vectors rotate counterclockwise
}
pos =...

stinkey

Forum adept
Joined
Sep 8, 2020
Messages
225
Reaction score
74
If you want an arc, you can try rotating a location around an axis in a loop for a certain amount of times.

How you would go about doing this is to have a location origin, vector axis, and a vector that is the vector to the particle, as well as an auxiliary location for the actual particle location.

Here's an example pseudocode:
C-like:
// some starting values that will define our arc

pfx = (whatever particle)

origin = Location (25.5, 51.5, 25.5)
axis = Vector (0, 1, 0)
vec = Vector (3, 0, 0)
degrees = Number 90

// drawing the arc

repeat Multiple(degrees) {
    pos = ShiftOnVector(origin, vec)
    DisplayParticle(pfx, pos)
    vec = RotateVectorAroundVector(vec, axis, -1) // -1, because vectors rotate counterclockwise
}
pos = ShiftOnVector(origin, vec)
DisplayParticle(pfx, pos)

This code would create a 90 degree particle arc from (28.5, 51.5, 25.5) to (25.5, 51.5, 28.5), parallel to the ground.

pfx - that's the particle effect you want to display
origin - this is where the center of the arc is. It'd be the center of the circle, if you were to fully complete the arc
axis - this is the direction the arc is facing. (0, 1, 0) means move 0 along the x axis, move 1 along the y axis (upwards), and move 0 along the z axis (x and z being the horizontal); think of it as a line that goes straight through the center of the circle perpendicularly
vec - this is basically a ray that rotates around the axis
degrees - the number of degrees to rotate, of course

1634010391134.png
 
Solution

mitsuki

New member
Joined
Sep 2, 2021
Messages
5
Reaction score
1
If you want an arc, you can try rotating a location around an axis in a loop for a certain amount of times.

How you would go about doing this is to have a location origin, vector axis, and a vector that is the vector to the particle, as well as an auxiliary location for the actual particle location.

Here's an example pseudocode:
C-like:
// some starting values that will define our arc

pfx = (whatever particle)

origin = Location (25.5, 51.5, 25.5)
axis = Vector (0, 1, 0)
vec = Vector (3, 0, 0)
degrees = Number 90

// drawing the arc

repeat Multiple(degrees) {
    pos = ShiftOnVector(origin, vec)
    DisplayParticle(pfx, pos)
    vec = RotateVectorAroundVector(vec, axis, -1) // -1, because vectors rotate counterclockwise
}
pos = ShiftOnVector(origin, vec)
DisplayParticle(pfx, pos)

This code would create a 90 degree particle arc from (28.5, 51.5, 25.5) to (25.5, 51.5, 28.5), parallel to the ground.

pfx - that's the particle effect you want to display
origin - this is where the center of the arc is. It'd be the center of the circle, if you were to fully complete the arc
axis - this is the direction the arc is facing. (0, 1, 0) means move 0 along the x axis, move 1 along the y axis (upwards), and move 0 along the z axis (x and z being the horizontal); think of it as a line that goes straight through the center of the circle perpendicularly
vec - this is basically a ray that rotates around the axis
degrees - the number of degrees to rotate, of course

View attachment 1045
tysm this helps a lot
 
Top Bottom