shao 0 Posted January 26 Share Posted January 26 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)) 0 Quote Link to post

MighT 42 Posted January 26 Share Posted January 26 It's hard to tell the issue from just this screenshot, without knowing more details, especially about "Travelinger"... Here's how I'd do it: And here's the scene file: test_xpresso_distance_per_frame_2.c4d Cheers 1 Quote Link to post

shao 0 Posted January 26 Author Share Posted January 26 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 ? 0 Quote Link to post

MighT 42 Posted January 26 Share Posted January 26 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 Cheers 0 Quote Link to post

jed 772 Posted January 26 Share Posted January 26 (edited) You can add incrementally by reading the current rotation value and adding to it every frame wheel.c4d 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 wheel2.c4d BaseWheel1.7.c4d adjust the Base80 wheel to same radius as the real wheel. Only move Base80 wheel by parent null. Edited January 26 by jed more info 1 Quote Link to post

noseman 51 Posted January 26 Share Posted January 26 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. Fun!!! Distance travelled 01A.c4d 2 Quote Link to post

jed 772 Posted January 27 Share Posted January 27 Interesting use of Tracer @noseman - no need to use pi twice though... 1 Quote Link to post

noseman 51 Posted January 27 Share Posted January 27 Doh... Note to myself: Hey noseman, it's because a Radian includes the Pi already... TWICE. That's why Radians are the default rotation unit... Thanks Jed... 0 Quote Link to post

jed 772 Posted January 27 Share Posted January 27 @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. 0 Quote Link to post

noseman 51 Posted January 27 Share Posted January 27 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. 0 Quote Link to post

MighT 42 Posted January 27 Share Posted January 27 The pie is a lie. Sorry, couldn't resist. 0 Quote Link to post

jed 772 Posted January 27 Share Posted January 27 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... 0 Quote Link to post

## Recommended Posts

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.