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.

Xpresso Increment Node


Recommended Posts

Hello guys 
im trying to make a car with two wheels, and trying to make those two wheel rotate dinamically with the car movements on the X,Z  axis, 
the problem i have is that i need a node or system using xpresso to get increment a value(distance traveled per frame) so i can get the whole distance traveled through the timeline and whatever the direction of the car is, 
so to make more simple i did a screen, what i want exactly is something that gives me the amount increment of the value in circle in every frame, 
like ((distance in frame 0) + (distance in frame 1) + (distance in frame 2) + (distance in frame 3) + (distance in frame 4) + ...........(distance in the current frame))


Link to comment

Hello Sir 
thanks at first 

what am i trying to do is to have a tyre of a car  rotates wherever the car goes, the wheel rotates correctlly, 
and i found that the only way to do it is to calculate the distance traveled until a certain frame,

using the distance between each two frames (ex:T1,T2 or T22,T23) and then calculate the sum of all the previous values, 

my prblem is that i dont find a node that calculate the sum of the distance values, 

how can i find a node like that ?



Link to comment

My recommendation would be to make use of a User Data parameter as storage for the distance travelled and simply sum the distance per frame into this.

For example it could look like so:


The additional Time/Equal/Condition node group is needed to reset the distance on frame 0, otherwise it's pretty straight forward. The "Distance Travelled" port is the User Data parameter of type Real added to my travelling cube, but you could add this parameter to basically any other object or tag you like and see fit.

And the scene: test_xpresso_distance_per_frame_3.c4d


Link to comment

You can add incrementally by reading the current rotation value and adding to it every frame




distance is always positive, so only works for the car going forwards. There's some clever code written by Base 80 that allows for forward and reverse. You make your wheel a child of the Base80 wheel eg






adjust the Base80 wheel to same radius as the real wheel. Only move Base80 wheel by parent null.

Edited by jed
more info (see edit history)
Link to comment

All above solutions can work great, and here's my input:

I'm using a Tracer Object, to trace a Cube (Turn Off Trace Vertices in the Tracer Attributes). This will generate a Spline and record the Cube's Trajectory (You can animate the cube by any means and I have chosen a Vibrate tag because I'm lazy).

Then we use XPRESSO to read the length of the Tracer Spline, as it reflects the distance travelled.

I use that as an input to a Range mapper that takes the Circumference of the Wheel (2*Pi*Radius), and maps that to one Radian (Negated because the wheel is going "the other way").

I then put that back into the Wheel P Rotation as Radians (Default Rotation Unit for XPRESSO).


I also use an "Align to Spline" Tag to align the wheel to the end of the spline, and set it to Tangential so that it follows the Spline Tangent and orient itself. The Tracer offers the ability to create wheel tracks as well.


Distance travelled 01A.c4d

Link to comment

@noseman I've actually seen solutions to the car wheel problem using the degree node twice, and bringing 360 into things 😁


For any radian noobs - a radian is the angle at the centre of a circle when the arc equals the radius. In this pic the red X is distance travelled by the car. Solving for A gives


angle = distance / radius




pi is defined by circumference = 2 pi R, but since we are not bothered about complete wheel rotations, pi doesn't really come into this calculation. Radian does not 'include' pi IMHO.

Link to comment
1 hour ago, jed said:

..pi doesn't really come into this calculation. Radian does not 'include' pi IMHO.

I meant that in the sense that 2π radians is equal to 360 degrees. So for a full rotation of the wheel, we have 2 Pies... hence the pie is very tasty.

Just in case I wasn't clear.

Link to comment

You mean this pie ?




re @noseman and pi


degrees are defined as 1/360 of a full rotation, but radians are defined by the arc radius malarkey - not by the division of a circle, so radian does not "include pi". The reason 360 deg = 2 pi radian is due to the definition of pi ie C = 2 pi R.


...changes username to Mr Pedantic...

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