Skip to content


 Zabbix
 Grafana
 Prometheus
 React Three Fiber
 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
   
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$6.99 $9.99 Paperback 
$22.99 $29.99




Design Patterns in TypeScript
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99




Design Patterns in Python
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99




position.subscribe

Working Example

Description

When a mesh is assigned to a Cannon body, such as a Box, Sphere, Trimesh, etc., its position and quaternion, will be continually recalculated due to the effects it encounters in the Physics world.

Sometimes you want to override the positioning of a cannon body. You can use the API to update a Cannon bodies position.

In this example, there is a grid of boxes created, and the height of each box is raised and lowered over time to create a wave effect. Dropping a Cannon Sphere onto this wave grid, causes the sphere to roll around.