Hope you can help me figure out something that's driving me nuts!
Currently working on a little game that involves lorries/trucks. I've got near enough everything sorted except for one thing...getting the lorry cab to pull the trailer. How on earth do I do that??? The trailer needs to follow the cab around realistically pivoting at the trailer's rear wheels and the trailer/cab connection.
Can anyone point me in the right direction or, even better, give me a peek at the actionscript that would sort this out?
Thanks for your help!
Spu
Error 745a - Bad or Missing Keyboard, press F1 to continue
wouldn´t that involve IK (inverse kinematic) ?
back in the days of GTA2 I remember some slobby implented attempt for doing that.
in any case it would mean that the trailer always points towards a spot of the truck (eihter the pivot itself or an offset pivot of that one). And with every move of the Truck the trailer would have to move with the truck within a constraint.
Is this even what you are searching for?
Yep, it's exactly what I'm after. To be honest I never knew anything about IK before your post but I've done a bit of reading on it now and it seems like the way I need to go. Thanks a lot!
Does anyone have any example code by any chance???
Thanks
Error 745a - Bad or Missing Keyboard, press F1 to continue
ChaseNYC - Thanks for the reply. Yep, I'd seen that when I was searching around for an answer. Although that's what I wanted to achieve, it did actually say how to do it.
Error 745a - Bad or Missing Keyboard, press F1 to continue
i had made something in class (due to boredom) that is similar to what you ask, not sure if it uses inverse kinetics though, i never read up on the topic
http://trogdorffe.tripod.com/attempted_optimization.swf
pardon me if its slow/poor looking, i made it kind of messy, and this is my attempted optimization
basically i find the dircetion one chain link is relative to another, and whilst keeping the same direction, set the distance to a constant
all the while, adding the _x and _y differences to the x and y speeds (later on during my boredom, I also distributed this energy between the two links evenly, to simulate action/reaction pairs, didnt seem to change much though)
virtual chain!! got a better looking one on my comp that has a bevel effect added
I've read through all of the info you guys have given me but *still* having trouble putting it into practice. It's the ability to control it with the keyboard rather than the mouse that's giving me grief.
I've attached what I've got so far but the movement is wrong. Keys UP & DOWN should make it go forward and backwards not increase/decrease the Y position. The same goes for LEFT & RIGHT keys.
Anyone get an ideas, please?
Thanks to everyone for your help!
Error 745a - Bad or Missing Keyboard, press F1 to continue
Yep, the car/cab to move like a normal car would and the trailer to follow. I've tried using the code I was using before I added the trailer that rotated the car but that then screwed up the movement of the trailer.
Error 745a - Bad or Missing Keyboard, press F1 to continue