Reinventing the BaseWheel
Finally the wheel solution that works in all situations.
Follow up:
How does it work?
Well I honestly don't know. Majoul (fr) did the math and the magic. But it works and it works in all the situations I needed it to work in.
Just move the BaseWheel null parent and the cylinder will rotate accordingly.
You can modify the radius of the cylinder to fit your own model.
Here is the file : BaseWheel R.9.5+ Enjoy and post a comment or show me your animations.
And off course Donations are always welcome...
12 comments
AS Usual
You rock!
Do you know anything where I can have the same result in this, but it can be applied in the 4 wheels of a car, which means it have to had, the steering wheels also in the front.
I have taken a look at the Xpresso.
Dividing the distance betweem the last position of the null and the current position of the null by the radius, the rotation of the wheel in radians is obtained (that's why it works with any wheel radius).
On the other hand, there is a calculation of a vector between the current position and the last position of the null. Once this vector has been normalized and "dot multiplied" with the Z axis vector of the null object, as both vectors have a length of 1, the cosinus of the angle formed between the movement of the null and the Z axis is obtained. The usage of this is, mainly, to see whether the calculated radians have to be rotated in a direction or the opposite one (moving the null on the Z axis only will produce values of -1 or 1 depending on the Z direction chosen). If the null is moving on its Z axis in a non orthogonal movement, this operation will also indicate if the radian displacement has to be positive (cosinus =1) or negative (cosinus =-1).
Multiplying this direction value by the number of radians, and adding them to the last Y(P) rotation of the wheel will produce the total number of radians to set the to the wheel P.rotation.
I hope this is "kind of" understandeable.
Just divide (by something) the rotation of the wheel and feed it to the right rotation port of the pedals
You can replace the "Winkel Cos" coffee node with a "math multiply" setting its data type to normal (vnorm() = normal).
-Michael
(aka Sneaker)
PS: Love your blog, great work
Do I need a working knowledge of expresso to get this working for my model? thanks, great site!