schteppe / cannon.js

A lightweight 3D physics engine written in JavaScript.
http://schteppe.github.com/cannon.js
MIT License
4.63k stars 700 forks source link

How would you do a simple scale? #484

Open gree303 opened 1 year ago

gree303 commented 1 year ago

Hi all, I'm trying to get my head around this... was hoping someone can point me the direction.

I'd like to create a cylinder which is the center turning point of a "scale". Along the cylinder edge I'd like to add/constraint objects which act as "weights". In case the mass changes the cylinder will re-rotate to the new center of mass.

I'm playing around with the different constraints but never used it. Maybe some expert can tell me which contraint would be best. Thank to all and enjoy

Fy-Spot commented 1 year ago

i dont think you can just scale in cannon.js if u want to change the size off an object you should rather remake the shape with different lenghts. I am not sure though because I am just new to this