Jump to content

Dear Visitors

If your confirmation email doesn't arrive, give us some time while we manually approve your account. Support ticket is not necessary, we are checking new registrations regularly and approving if registration requirements are met.

Please read Rules & Guidelines before posting around Forums. Information we seek is minimal and in the end saves us a lot of time and we are able to provide solutions faster.

Please consider supporting us via Contributions for all the work we are doing. Contributing even with the smallest amount, will remove ALL AD's and unlock some nice features like being able to be Tipped for providing help, or file etc.


Angle difference between 2 matrices


Sandidolsak
Go to solution Solved by srek,

Recommended Posts

Just a note on why i use the matrix directly and not a conversion to rotation angles. The conversion can introduce jumping since there are often multiple angles possible that would define the same matrix orientation. Using the matrix directly resolves this.

Link to comment
  • Customer

Yeah, did a direct translation of the nodes and this is what it comes out
 

speed =  u.VectorMax(c4d.Vector(abs(math.acos(mx[i].v1.Dot(p_mx[i].v1))), abs(math.acos(mx[i].v2.Dot(p_mx[i].v2))) , abs(math.acos(mx[i].v3.Dot(p_mx[i].v3)))))


The only difference is I take the largest value of the 3 instead of building the color, looks like it works nicely.

Thanks again!!!

Link to comment
1 hour ago, Sandidolsak said:

Yeah, did a direct translation of the nodes and this is what it comes out
 

speed =  u.VectorMax(c4d.Vector(abs(math.acos(mx[i].v1.Dot(p_mx[i].v1))), abs(math.acos(mx[i].v2.Dot(p_mx[i].v2))) , abs(math.acos(mx[i].v3.Dot(p_mx[i].v3)))))


The only difference is I take the largest value of the 3 instead of building the color, looks like it works nicely.

Thanks again!!!

Just a remark, Python is unlikely to be faster than nodes, scene nodes are quite fast since they are a direct implementation of core functions, also they are automatically multi threaded where possible. So if you want to speed things up by using Python over nodes you likely shouldn't bother.

Link to comment
  • Customer

@srek So I was intrigued to try it with nodes but the first thing I try to setup, of course, doesn't work, I replaced the keyframes with a target object, it kills the memory node for some reason, it doesn't output the previous state, things like this frustrate so much 😞

I am pretty sure the setup is somehow wrong, but it shouldn't be, looking at it, it is so logical.

rot_diff_0004_target_01.c4d

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Copyright Core 4D © 2021 Powered by Invision Community