I’m trying out a pendulum using a DistanceConstraint.
I thought it would be a good idea to connect a string (cylinder in this case) to the ball, so I tried that, but it was displayed vertically, and I couldn’t get it to look like it was hanging from a string.
The cylinder isn’t a physical body itself, so we need to find its rotation ourselves. Thankfully, it’s pretty easy, you just need to compute the rotation that gets from its default up vector (0,1,0) to the vector formed between the ball and the box: Experiment swinging the pendulum | Babylon.js Playground (babylonjs.com)
Pretty cool looking PG btw! Can we add it to the docs?
Thank you for adding it to the documentation sample.
BTW, I have a simple question about pendulums.
It seems that the pendulum’s swing gradually slows down, but where are its parameters specified? I tried changing friction and restitution, but it didn’t seem to have anything to do with damping.
Thank you for teaching me that method.
However, it seemed that even if I set it to zero, I could not completely eliminate the attenuation. Am I using something wrong?