hi all, 

I'm working with some bezier curves (ultimately, the goal is to benchmark 
maya bifrost against regular maya - if you have any reference to share, 
regarding bifrost perfs, feel free!).
I get my pos at parameter using directly matrices, no decasteljau involved, 
I find it more elegant:
v_t = np.array([1, t, t**2, t**3])
cubic = np.array([
    [ 1.,  0.,  0.,  0.],
    [-3.,  3.,  0.,  0.],
    [ 3., -6.,  3.,  0.],
    [-1.,  3., -3.,  1.]
])
pos_at_param = np.dot(np.dot(v_t, cubic),  control_points)

Works just fine. But I would like to compute my tangents using the same 
logic

Whether I start from 
(1-t)**3 + 
3(1-t)**2t + 
3(1-t)t**2 + 
t**3
gets all those derivatives, and recreate a matrix out of it,

or start from the derivative I found online
3(1-t)(1-t) * (p1 - p0) + 
6t(1-t) * (p2 - p1) + 
3tt * (p3 - p2)
giving me 
  [ 3.,  0., 0.]
  [-6.,  6., 0.]
  [ 3., -5., 3.]

None of those seem to give me the actual derivative / tangent vector on my 
curve at the given param. Am I doing something? Is it simply impossible to 
compute the tangent of a curve using the same logic than the position?

Thank you


-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/624b365c-37a4-457e-8956-ffc6f3926190n%40googlegroups.com.

Reply via email to