Archived

This topic is now archived and is closed to further replies.

Cubic Beizer Patches

This topic is 5381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A couple of questions. First I have the equation S^T*M*P*M*T. S and T are the parameters, i.e. (s^3,s^2,s,1). M is a symmetric matrix of coeffients that you would have in a beizer curve, specifically [[-1,3,-3,1], [3,-6,3,0], [-3,3,0,0], [1,0,0,0]]. P is a 4x4 matrix of control points, i.e. a matrix of vectors. So one question is can I convert this so that P is a 3x16 matrix of scalars. Second is there any way to get the two M''s together so that there is just one matrix of constants. I can rearrange the equation using A*B=(B^T*A^T)^T. Every permutation I tried ended up without being able to combine them. With the other I can figure out how to convert a vector of vectors for a cubic beizer space curve to a matrix of scalars, but I don''t really understand why it works there. I''m inclined to think it is because a vector of vectors is just two dimensional. Here it is really three. The dimensions of the matrices also seem to say it can''t be done without some drastic changes. It seems like it would be a 3x16 * 16x16 * 16x1 to produce a 3x1. The 16 by one would be s^3*t^3, s^3*t^2, etc I would assume. I have a good idea where the 16x16 comes from. Specifically if I expand the equation and collect the s*t terms then I have coefficents involving up to all 16 points. That is extremely tedious. There are a lot of terms involved. I''m not sure how many, but I would assume about 136. 16 for the first row, 15 for the next, etc. It seems like it could be a matrix built from M directly, but I''m at a loss as to how it would be constructed from M. Finally I''m not sure it is actually worth it. I can premultiply the M*P*M term. It seems like it might takes just a few more multiplications for 3x16 * 16x16 * 16*1 than 1x4 * 4x4 * 4x1 repeated three times. Even so it would make things easier in some of the math packages for coming up with exactly what I want to do with these patches.

Share this post


Link to post
Share on other sites
I figured out what the 16x16 matrix would be. You can lay it out as a 4x4 matrix of 4x4 matrices where each is product of a column and row of the coefficent matrix. That process also seems to make it pretty clear that there is no way those two matrices of constants could be combined. The s^3*t^3 term has all 16 points in it''s coefficent. The only way to achieve that is two matrix multiplications. I also realized I could premultiply the 3x16 and 16x16 matrix making 3*16 multiplies. That doesn''t count the 16x1 parameter matrix which takes 16 more so still not efficent, but more reasonable.

Share this post


Link to post
Share on other sites