van's door Rot limit <how?>

Hi

as you can see in the image , i want the two back doors of the van to rotate according to the speed of the van , hinge constraint is usefull here ? , but how can i limit the rotation to specific given values of degrees ?

by the way , i want this to happen to both doors …
thanks

Attachments


I don’t know a lot about this but…

Maybe you can get rotation’s door (getOrientation I think) and with python write something like

if rotation>xxx degress:
rotation=rotationlimit

But I think georientation works with a 3x3 matrix, and maybe is a little complex to write it.

Sorry I can’t help you more.

Well, maybe it’s just me who don’t get it, but can’t you just add a limit rotation constraint to both doors?

/ Mats

Ya, too bad there isn’t a rotation constraint, maybe they could make one. It would really help out in a lot of ways.

At least in 2.44, there is a limit rotation constraint. There is even a stubby page about it in the wiki manual (link),

/ Mats

Ha, I was tinkering with something just like this yesterday. I ended up using an ipo with properties linked to it. I had an ipo animation for the door opening, then a property (int, with the last frame of the animation as the value) and two keyboard sensors. The first sensor, arrow up, would add 3 to the animation property, and the second sensor, arrow down, would subtract 3 to the animation property. Then, I just added an always sensor and an ipo actuator with the animation property…and it worked…hope that helped (i can whip up a .blend file if you want me to…)

(i can whip up a .blend file if you want me to…)

i understood your way , but post a blend , maybe someone will ask the same question a day

your way works , but it is not dynamic and interactive as i want , thanks Turin :slight_smile:

Yah, Here’s the file… arrow keys to open and close the door…

what kind of dynamic do you need 3D

you should make some basic collision box for the door

I would just do the animation with an armature, and time it with a cube that moves out of the way when the player needs to enter the van.

ok , i will try to clearfy , i want the van to move some curves and skid etc , but the doors at the point where it is at a hard shaped curve , they doors must open/close <maybe lets say flicker> , as realistic as possible .

the van is controlled through the player , there are ways to do this , but i want it to happen through Bullet’s constraints .

edit :-
@ Turin , thanks but guess what , you should have made the both properties as 1 instead of 31 for it to work :slight_smile: .

Just make it rotate out the way you are turning, even a sharp curve takes time, then when you stop turning, the turn key is released the ipo stops.

Ititrx, that is a really good idea! You could just play the animations with the flipper option!!

please , any help will be apreciated
@PP :- it’s not quit solved yet , so don’t close the thread please :slight_smile: .

if your door is a dynamic object, try Generic Rigid Body Joint. I guess in this situation you need to limit Z axis. So try “Ang Min Z” -1 and "Ang Max Z " 1. As i remember max number (360°) was 5. Unfortunately there was some strange glitches when car flips over, I have an old demo here : http://files.filefront.com/carGears+doorsblend/;7587202;/fileinfo.html

very good at the begining but after a small period it’s really buggy as you have said :frowning: .
thanks martinsh .