March 05, 2021, 06:47:44 PM

Author Topic: AlignToVector  (Read 197 times)

Offline JBR

AlignToVector
« on: February 09, 2021, 08:49:47 PM »
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

Offline STEVIE G

Re: AlignToVector
« Reply #1 on: February 09, 2021, 09:16:27 PM »
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.

Offline RemiD

Re: AlignToVector
« Reply #2 on: February 10, 2021, 06:47:40 PM »
Quote
e.g. would 0.1 take 10 frames to align?
i think so

0.1 is 1.0/10 so it makes sense
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline STEVIE G

Re: AlignToVector
« Reply #3 on: February 10, 2021, 06:59:39 PM »
Quote
e.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.

Online iWasAdam

Re: AlignToVector
« Reply #4 on: February 10, 2021, 07:58:25 PM »
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...




Offline STEVIE G

Re: AlignToVector
« Reply #5 on: February 10, 2021, 08:44:03 PM »
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.

Offline RemiD

Re: AlignToVector
« Reply #6 on: February 11, 2021, 11:06:19 AM »
i meant, 10 steps (intermediate vectors, from start vector to final vector)

but not sure how it really works
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline JBR

Re: AlignToVector
« Reply #7 on: February 11, 2021, 11:56:09 PM »
It seem to move gently at the start and finish, so I suppose it's not easily timed.

Jim

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal