• Create Account

#ActualNyssa

Posted 21 December 2012 - 05:54 PM

Moreover, your method only takes direction into account and would incorrectly merge the vectors (1,1,1) and (2,2,2) since their sum (3,3,3) is in the same direction as (1,1,1).

That's correct. Sorry, I shouldn't have been talking about adding vectors together. Lets say you have 4 points (1,1,1), (2,2,2), (3,3,3), (4,4,4). If you place these points on a graph then the resulting line would be straight. Therefore there is no need for points (2,2,2) and (3,3,3) so you would just keep keys (1,1,1) and (4,4,4).

If however we have the points (1,1,1), (2,2,2), (3,-20,3), (4,4,4) you would need to keep all the points otherwise your animations won't follow the correct paths.

You would always store the first keyframe and the last keyframe anyway so that your animation runs from the first position to the end position correctly. Then you would make the direction from A to B the first comparison direction. Then test the direction from A to C. If the direction is about the same as the first comparison direction then throw away B. The next test would be from A to D and so on....

If the direction from A to C wasn't in the same direction as A to B then you would need to keep B. Because without this point your animations wouldn't follow the correct path. The direction from B to C would become your new comparison direction and you would repeat the above test for B to D and so on...

#1Nyssa

Posted 21 December 2012 - 05:49 PM

Moreover, your method only takes direction into account and would incorrectly merge the vectors (1,1,1) and (2,2,2) since their sum (3,3,3) is in the same direction as (1,1,1).

That's correct. Lets say you have 4 points (1,1,1), (2,2,2), (3,3,3), (4,4,4). If you place these points on a graph then the resulting line would be straight. Therefore there is no need for points (2,2,2) and (3,3,3) so you would just keep keys (1,1,1) and (4,4,4).

If however we have the points (1,1,1), (2,2,2), (3,-20,3), (4,4,4) you would need to keep all the points otherwise your animations won't follow the correct paths.

You would always store the first keyframe and the last keyframe anyway so that your animation runs from the first position to the end position correctly. Then you would make the direction from A to B the first comparison direction. Then test the direction from A to C. If the direction is about the same as the first comparison direction then throw away B. The next test would be from A to D and so on....

If the direction from A to C wasn't in the same direction as A to B then you would need to keep B. Because without this point your animations wouldn't follow the correct path. The direction from B to C would become your new comparison direction and you would repeat the above test for B to D and so on...

PARTNERS