Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hello, I rewritten spline ik due to some requirements, but I was stuck on the problem of rotation. I have tried to use up interpolation or spline trail, but there will still be their own problems. I also searched a lot paper, but did not find a clear solution, do you have any good ideas,or are these papers recommended?
welcome any ideas
@chuanzhen said in Discussions about spline ik:
I read the paper and watched the video. The video is understandable and the paper is still obscure.
Which paper are you referring to? The RMF paper? It has a chunk of pseudo-code you can straight up copy.
The Parallel Transport method is useful, but using the control object to control the rotation of the joint (rotate around z) is still a bit unclear (in the picture below).
I am still unclear on what is intended on what is not in your pictures. Is the twisting motion of your chain of objects intended or not? It would probably be best, if you just would generate an image of what your algorithm currently gives you and then create a second image, where you have fiddled your objects by hand into the orientation, you want them to have.
The paper seems to mention some solutions such as (Animating rotation with quaternion curves) and (Fiber bundle twist reduction.)
I am still not sure which paper you are talking about. There are other algorithms, especially a lot of hacks for PTF, but at least I would say that RMF will give you the best results, while being relatively simple, and PTF (or a naive version of aPTF like shown in the video) will give you good results, while being very simple. You have also to keep in mind that these all are hacks, i.e. algorithms for imitating what humans would consider an aesthetical set of frames placed on a curve. In reality the normals and bi-normals of a curve will flip based on the tangency of that curve.
Cheers, zipit
Hi @chuanzhen, thanks for reaching out us.
Although the topic is not strictly related to Cinema 4D plugin development can you please elaborate more on what's the "problem of rotation" you're referring to and what you mean by "up interpolation" or "spline trail"? This will avoid the whole community to do useless guess work and maybe provide based on your context better suggestions.
Cheers, R
Are you talking about constructing a series of frames along a spline? At least that is what I get from your question. I assume you are using parallel transport (what you seem to call up-interpolation) to construct the frames and ran into the banking problem that comes with that task in general and the PTF algorithm in particular (what you are referring to as rotation).
Unfortunately there is no easy answer or fix to this problem, as there is no mathematical foundation for that what humans would consider a "logical" set of frames for a spline.
As you also talked about papers, you probably already found Rotation Minimizing Frames, which is the common solution for the shortcomings of PTF, but also a bit more involved. Could you elaborate on where you are stuck?
@r_gigante @zipit The detailed explanation is shown below “up interpolattion” Try use "spline trail"
I read some papers, but always been very slow, just only expanded know, such as Frenet–Serret formulas etc. But I did not directly find a better way to replace my current method, and I have been looking for it.
Computation of Rotation Minimizing Frames This seems to be a good paper, I will read it carefully.
Hi,
# With a hypothetical type 'Frame' which has the attributes i, j, k # for the components of a frame. tangents = get_tangents() frames = [] for n, t in enumerate(tangents): # Select our 'up vector' based on n. up_vec = SOME_UP_VECTOR if n is 0 else frames[n - 1].j # This is the vector we construct diffrently based on wether # we are constructing the zerost or nth (n != 0) element. temp = up_vec x t i = normalize(temp x t) j = normalize(i x t) k = normalize(i x j) frames.append(Frame(i, j, k))
edit: Ah, I see now the marked problem in the second image. It is rather hard to just judge that from looking at an image, but at first glance I cannot see a reason, why a standard PTF should fail on that spline (as there are no drastic changes in tagency in your spline and its not closed either). You should double check your algorithm. If things remain unclear, check the PTF link I have posted above. However, be aware, that most cases "drastic tangency change" cannot properly be solved with PTF or a naive implemenation of aPTF that just smoothes the banking of your frames.
edit2: What I was probably also unclear about, is the term "banking problem". It refers to the orientation of your frames along the axis of tangency, i.e. what you call "rotation".
@zipit Thank you for your patient reply, it really helped me a lot. I need to learn about PTF,This is a new point of knowledge for me, and I need some time to understand how it works. I will update the progress of the solution here. Yes,rotation is banking ,in my method it points to the next object in the chain of objects,not use tangent
in my method it points to the next object in the chain of objects,not use tangent
I am not quite sure how you mean that, but to be clear: If you have a chain of objects, i.e. an array of line segments, then the vector from the position of the current 'object' to the position of the next 'object' is the tangent of the line segment array at that point. Or in other words: The tangents in my example above are the vectors from the point n to the point n+1 in the list of points of a segementized spline.
Cheers zipit
@zipit Hi, I came back a bit late. I read the paper and watched the video. The video is understandable and the paper is still obscure. The effect of Parallel Transport is similar to some functions of c4d python utils.SplineHelp (). The Parallel Transport method is useful, but using the control object to control the rotation of the joint (rotate around z) is still a bit unclear (in the picture below). The paper seems to mention some solutions such as (Animating rotation with quaternion curves) and (Fiber bundle twist reduction.)
@zipit Thanks,this paper Parallel Transport Approach to Curve Framing I will follow your suggestion to explore RMF. It may be that the language barrier prevents us from communicating well, but I still get a lot of help from your answer. I use Google translate