I tested the code that you posted with my models from the 3PM article. It worked fine for me... You should change this line so it works better(you must have typed it wrong):
What you had:
h_id = phcon_add(ph_hinge, my, hinge);

Change To:
h_id = phcon_add(ph_hinge, my, 0);

The reason for this is that you are not needing to set up 2 contraints with ph_hinge. Ph_wheel for an example, requires two contraints(the wheel, and the body), but with a hinge constraint you only need one which would be the door entity.

I doubt changing that line will fix it for you, it is most likley an origin problem with your models. Are you origins set right in MED? The origins of the models in MED is where the two objects connect via the constraint, if these are set wrong then you will experience very weird behaviour since it will be rotating itself around the messed up origin. As you may know, "my.x" is the origin of the entity in MED. Since the anchor point of the door entity is "hinge.x", your door model will swivel around the origin of the hinge model. Load up the models that I used in 3PM and look at how I set up the origins and duplicate it for your models.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/