calin_casian Posted October 30, 2003 Share Posted October 30, 2003 I'm trying to animate a car running down a track. I use path obj. for the car to move but now I have to turn wheels as well. The parameter orient along path keeps the vehicle tangent to the path. How can I use this to rotate my wheels along Y, or something else? thx, calin Quote Link to comment Share on other sites More sharing options...
andrewa Posted November 5, 2003 Share Posted November 5, 2003 hello, Using the "deg" expression you can convert translation values to rotation values. In your case, since you are using a path object you need to find how much the object is translating. At the moment, the only way I can think of ( unless anyone can think of another way ), is to find the bounding area of the path object and compare it to the bounding are of the car. This way you can use CHOPs to fetch in the path value, just incase the car goes backward at any time, then follow that with a Math CHOP to multiply it by the difference between the bounding values. Then follow that with an expression CHOP with the expression: deg($V) Then export that value to something like the Primitive sop's rotation. Andrew Quote Link to comment Share on other sites More sharing options...
tallkien Posted November 5, 2003 Share Posted November 5, 2003 A little high school math recap perimeter of circle = 2*PI*r so in one rotation (360 deg) your circle will travel a distance of 2*PI*r... So for any distance x your circle should rotate x*360/(2*PI*r) or in Houdini 360/(PI*$BBY) where $BBY is the bounding box of your tyre. Actually the expression will look more like distaceTravelled*360/($PI*bbox("/obj/tyre",D_SIZEY)) Since you are using a path you won't have translate values for your car for which you'll need to use chops Use an object chop and then a slope, that should give you the velocity vector( and direction as a perk just in case you want to automate steering too ) The length of this vector is the distance your car travels in each frame, Hope this helps Quote Link to comment Share on other sites More sharing options...
calin_casian Posted November 6, 2003 Author Share Posted November 6, 2003 well, tallkien I think you get it wrong or I don't know enough english (since it's not my mother language, it happend before) to explain my problem. It's not the problem about rotating the wheels to give the impresion that the car it's moving forward it's the "steering", my up axis is Y that's why I asked how can I rotate the tire in Y acordingly to the path. But I guess the answer to my solution is in your reply (about that CHOP stuff) thx calin ps. btw I know the relation between the circle lenght and how many deg it must be turn to cover a given distance Quote Link to comment Share on other sites More sharing options...
tallkien Posted November 6, 2003 Share Posted November 6, 2003 sorry about that, I misunderstood. Glad it helped anyway Quote Link to comment Share on other sites More sharing options...
exarhos2003 Posted November 10, 2003 Share Posted November 10, 2003 not exactly sure what you are trying to acheive, are you trying to get the steering to look correct. If that is it, you may try use set the normals of the path to face their correct tangents and rotate the tires based on the curves normals directions. If this sounds like what you are looking for, ill try to go further on it. christopher Quote Link to comment Share on other sites More sharing options...
meshsmooth Posted November 10, 2003 Share Posted November 10, 2003 and if you want to get the curve normals to do that i just made a vex sop that dose it a treate so if you are keen i have given it out at the end of this topic. controling curve normals with vex? Quote Link to comment Share on other sites More sharing options...
tallkien Posted November 11, 2003 Share Posted November 11, 2003 I don't think curve normals would offer a very accurate solution for orienting a car's steering wheels. Ideally if you were to put a car on a path, the pivot of the entire car would be at the center of the rear axle. If you sample the direction vector of a point on the front axle (which will be different from the rear) it becomes easy to simply orient the front wheels to this vector, which I think is what calin ended up doing. This would also make the system generic so it won't matter if you animate with a path, keyframes or any other way Come to think of it, you can use the same technique to orient the whole car itself, so all you have to do is animate just the position of the car and let Houdini do the driving so to speak Quote Link to comment Share on other sites More sharing options...
tallkien Posted November 11, 2003 Share Posted November 11, 2003 here's a simple example of a wheel done in chops. Just for fun, disconnect the path and just key the wheel's position ps: helps to add an upvector (0,1,0) if you're keyframing wheelAnim.zip Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.