AlignToVector

Started by JBR, February 09, 2021, 20:49:47

Previous topic - Next topic

JBR

Finding this command quite useful.

The <rate> is set to 1 for immediate.

Is there a relationship between <rate> and time.

e.g. would 0.1 take 10 frames to align?

Jim

STEVIE G

Quote from: JBR on February 09, 2021, 20:49:47
Finding this command quite useful.

The <rate> is set to 1 for immediate.

Is there a relationship between <rate> and time.

e.g. would 0.1 take 10 frames to align?

Jim

No, its just 10% of the remaining delta. to the target vector. Not sure if there's a min threshold which then snaps to target.

RemiD

Quotee.g. would 0.1 take 10 frames to align?
i think so

0.1 is 1.0/10 so it makes sense

STEVIE G

Quote from: RemiD on February 10, 2021, 18:47:40
Quotee.g. would 0.1 take 10 frames to align?
i think so

0.1 is 1.0/10 so it makes sense

This is totally wrong, Say your aligning to a vector 90 degrees away. Step 1 you'll have turned 9 degrees, step 2 - 17.1, step 3 - 24.39, step 10 - 58.6189. So after 10 frames you'll still be 30+ degrees away.

iWasAdam

you also have to take into account 0/Pi2 (0/360) issues.
E.G.
- lets assume you are using degrees. you are pointing at 359 and you want to go to 10.
- 10 < 359 so you decrease the value until it gets to 10 :) WRONG
- you actually want to increase the value (jump to 0 and keep increasing) util it reaches 10

What you end up with is situations where instead of just going to the next position, you rotate 360 to get to the finish - it can look cool in the reight place, but is wrong and you'll need to track directions and make the correct decisions...




STEVIE G

Quote from: iWasAdam on February 10, 2021, 19:58:25
you also have to take into account 0/Pi2 (0/360) issues.
E.G.
- lets assume you are using degrees. you are pointing at 359 and you want to go to 10.
- 10 < 359 so you decrease the value until it gets to 10 :) WRONG
- you actually want to increase the value (jump to 0 and keep increasing) util it reaches 10

What you end up with is situations where instead of just going to the next position, you rotate 360 to get to the finish - it can look cool in the reight place, but is wrong and you'll need to track directions and make the correct decisions...

This won't happen using aligntovector.

RemiD

i meant, 10 steps (intermediate vectors, from start vector to final vector)

but not sure how it really works

JBR

It seem to move gently at the start and finish, so I suppose it's not easily timed.

Jim