This week was uneventful--although I was trying to resolve an issue with the NPC's facing and the Bezier paths, it did not work out.
I uploaded last week's more stable version to our new svn server.
Here is the math I used to make the middle Bezier control point formula--in case someone sees what I missed.
The goal is to complete:
B(t) = (1-t)(1-t)a + t(1-t)b + t*t*c
given that I know B'(t) for t=1 and t=0, a, and c.
I was using the derivative to solve for b because t=0 should be startT and t=1 should be endT:
B'(t) = 2(1-t)(b-a) + 2t(c-b)
startT = 2(b-a)
=> 0 = 2(b-a) - startT
endT = 2(c-b)
=> 0 = 2(c-b) - endT
2(b-a) - startT = 2(c-b) - endT
startT - endT = -2b+2a +2c-2b
startT - endT = 2(a + c) - 4b
4b = 2(a + c) - startT + endT
b = (2(a + c) - startT + endT)/4
I could have made an error on campus--I'll check on it Monday.
No comments:
Post a Comment