PDA

View Full Version : expressions for rotating wheels


benthomas2222
08-02-2005, 03:48 PM
i am creating an old racing car the modelling is complete and texturing nearly done, can anyone help me with the animating of the car, i was going to use rigid body simulation but i think this is overkill!!!

i think the best way is expressions can anyone help?

im very new to the expressions side of animation


cheers

ben.

P.S big up cumbria insitute of the arts!!

3dtutorial
08-02-2005, 04:34 PM
i am creating an old racing car the modelling is complete and texturing nearly done, can anyone help me with the animating of the car, i was going to use rigid body simulation but i think this is overkill!!!

i think the best way is expressions can anyone help?

im very new to the expressions side of animation


cheers

ben.

P.S big up cumbria insitute of the arts!!


You might be interested in this commercial tutorial then...

http://www.3dtutorial.com/xsi.php?detail=43

As this topic and suitable solutions are discussed at length.

Kind regards,

/joe

patconnole
08-02-2005, 06:43 PM
If you're talking about making the wheels turn when the car moves, there are two basic ways to go about it: using an expression or using linked parameters.

To figure it out, I'd suggest using a practice scene so you don't screw anything up in your current scene.


An example: write an expression that changes the x rotation on a wheel, based on the wheel's x position.

-open up the wheel's local kinematics page (ctrl k)
-right click on the x rotation button, then click on 'set expression'
-in the white area of the page that opens up (where it probably says the current value of the x-rotation), write something like

(-180/PI)*cylinder.kine.local.posx

This assumes you've got a radius of 1, so you'll have to compensate it for other sizes.

The other way to do it is with linked parameters. You can look up in the manual how to do it, but the basic method is:

-open up the wheel's local kinematics page (ctrl k)
-right click on the x rotation button, then click on 'link with'
-in the explorer that pops up, navigate to your object's local kinematics x position (just click on it)
-Set your relative values. (two keys that define the relationship)
-Adjust the Fcurve of the relative values to be linear and extrapolatedized. Yep, extrapolatedized (so it goes on forever).

Hope this helps.

benthomas2222
08-03-2005, 05:38 AM
thanks guys i will give it a go

MyAMeE
08-03-2005, 11:00 AM
Its funny that I came across this post. Just a few days ago I asked on another site on how to go about doing this. I saw a video tutorial in maya by http://www.lostpencil.com/ (http://www.lostpencil.com/) on this very same question. The thing is a math formula was done to determine on how the wheels will turn. The script was done in mel and I do not know maya at all, but the formula is pretty universal and should work in no matter what language script you use. Considering that this is a public forum I will not provide the script here due to copyright issues. How ever you can take a look at http://www.lostpencil.com/wheelsub.html (http://www.lostpencil.com/wheelsub.html) . You can try and duplicate the process in XSI if you know what your doing, or convert the whole thing from maya to xsi by using Point Oven (http://www.ef9.com/ef9/PO.htm)to do so.

patconnole (http://forums.cgsociety.org/member.php?u=92037): I will also try and do it your way. Seems much easier than doing a lot of code. If you could provide a visual on how to go about doing this that would be a plus.

MyAMeE
08-11-2005, 08:12 PM
Ok guys I found out on how to make car wheels rotate in XSI. Its easy, and I made a tutorial on how to do so. http://www.3d-palace.com/index.php?option=com_forum&Itemid=26&page=viewtopic&t=7773

3dtutorial
08-11-2005, 08:51 PM
Ok guys I found out on how to make car wheels rotate in XSI. Its easy, and I made a tutorial on how to do so. http://www.3d-palace.com/index.php?option=com_forum&Itemid=26&page=viewtopic&t=7773

It's also quite a limited solution to the problem... but that may be good enough depending upon the application required.

Cheers,

/joe

mmmaya
08-12-2005, 01:06 AM
There is a script in your local netview to help do this

Animate>Create - Wheel

Or type in wheel in your netview seacrh box

3dtutorial
08-12-2005, 03:00 AM
There is a script in your local netview to help do this

Animate>Create - Wheel

Or type in wheel in your netview seacrh box

Chin

Yes, that is true.... but be advised that this is not a very robust solution. However, if you only need something simple it should do nicely.

Cheers,

/joe

ggg
08-12-2005, 06:43 AM
Yes, that is true.... but be advised that this is not a very robust solution. However, if you only need something simple it should do nicely.

Cheers,

/joe

yeah I should update that old wheel to something more robust.

In the mean time yeah buying Helges stuff is good investment! We bought them for my team here as he's not around now.

dwigfor
08-12-2005, 09:03 PM
Helge finished up at Omation? Hope he'll still be attending the LA User Groups!

Thanks for the tutorial for NetView/Wheel. I got that working.. Got a question, though. I drew a curve, constrained my car (actually I just made a cube with cylinders to try this out) to the path. How can I get the tires to rotate as the car turns (Netview/Wheel gets them turning in x, I want them to follow the path on z)?

3dtutorial
08-12-2005, 09:23 PM
Helge finished up at Omation? Hope he'll still be attending the LA User Groups!

Thanks for the tutorial for NetView/Wheel. I got that working.. Got a question, though. I drew a curve, constrained my car (actually I just made a cube with cylinders to try this out) to the path. How can I get the tires to rotate as the car turns (Netview/Wheel gets them turning in x, I want them to follow the path on z)?

Yes, well you see that is where things get tricky and this is why it's only a limited solution to the problem.

Cheers,

/joe

ggg
08-13-2005, 12:36 AM
Helge finished up at Omation? Hope he'll still be attending the LA User Groups!

Thanks for the tutorial for NetView/Wheel. I got that working.. Got a question, though. I drew a curve, constrained my car (actually I just made a cube with cylinders to try this out) to the path. How can I get the tires to rotate as the car turns (Netview/Wheel gets them turning in x, I want them to follow the path on z)?

Yep Helge is back in Germany now.

There's an old Softimage cheat for faking rotations and wheel roll I'll google this weekend if get a chance.

A REALLY simple cheat (that is still visually accurate) is to plot paths for each of the wheels after working out your animation then using the path percentage to drive wheel rotation.

alona
08-13-2005, 12:50 AM
Here's what I did, see if this works for you.

1. Get a cube (Car), a cylinder (wheel), and a curve (road). Model the car and the wheel and freeze their transforms, just to be on the safe side. Do NOT parent.

2. Path-constrain the car to the road. Activate Tangency and set the appropraite axis (probably Z or X). Now when you play with the path %age the car follows the road and orients properly.

3. Pose-constrain the wheel to the car. Click CnsComp and move the wheel to the appropriate location relative to the car, click CnsComp again. Now when moving the car along the road, the wheel will follow.

4. Open the PPG for the wheel's pose constraint, click Options and DEACTIVATE "Orientation". We need to do this in order to be able to control the wheel's revolution.

5. First, fix the wheel's orientation: link the wheel's Y rotation to the car's Y rotation. Just put car.kine.local.roty in the expression editor for the wheel's Y rotation.

6. Finally, to make the wheel revolve, put the following expression in the X rotation:

Car.kine.pathcns.perc * 10

The factor of 10 you'll need to play with, it basically controls how many revolutions the wheel will go through as the car travels the full road from 0 to 100. Calculating this should take into account the length of the curve; I think ther's a way to ask XSI to calculate this length for you but I forget what it is.

I think it's easiest just to play around with this parameter until you get the wheel to "stick" to the road, but if you want the formula, it is:

X rotation = Car.kine.pathcns.perc * L/R * 0.573

where L is the length of the road and R is the radius of the wheel. This 0.573 is just 360/(2*PI*100).

--

Now, with a REAL car, of course the wheels are not always parallel to the car like they are here. I don't have a good general solution right now for how to get realistically-turning wheels, I'll think about it.

Hope that helps,

AA

dwigfor
08-13-2005, 05:26 AM
Thanks for the reply Alona! I'll have to try that out..


I'm just starting to animate in XSI - spent the last 7 months learning the interface and modelling and basic texturing.

Got some great news today, though. Our creator was in town from NY and I showed him my first 2 scenes done in XSI. He was BLOWN AWAY!

From now on we're gonna start using XSI for our POV games inside our show. Spent about 3 years starting to learn 3d with Lightwave. All I was able to get in our show was box covers opening and volumetric spotlights (which I still don't know how to do yet in XSI). Did get modelling down pretty good. But trying to animate.. Said "there's gotta be a better way than this." That's when I jumped ship and switched to XSI. In 8 months with XSI, I was able to complete 2 scenes with 3d backgrounds (ok, for starters, they're only images mapped onto grids, but when I get a break in my schedule, I hope to start actually modelling environments). First scene was a POV inside a jeep driving down a road. Did the bg in XSI and the jeep overlay in After Effects. I'm hoping to be able to pull the camera back to show the actual jeep driving, which I've already modelled. Still need to model my character, who's driving.. Looking forward to it!

Alana, you said you were a tut freak.. Happened to have bought 3d quakers- interactive car rig? Anyone else buy this? Is it usable in production? Looks awesome! If you guys say it's good, I'm gonna try to get my production to buy this.

alona
08-13-2005, 05:52 PM
Yup, I have Interative Car Rig, but I didn't "do" it yet. My experience with 3dquakers tutorials, however, has been very positive. If your production callls for car rigs, I'm sure there will be useful tricks there for you.

AA

CGTalk Moderation
08-13-2005, 05:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.