Basic supported shapes

Physijs provides a number of shapes you can use to wrap your geometries. In this section, we'll walk you through all the available Physijs meshes and demonstrate these meshes through an example. Remember that all you have to do to use these meshes is replace the THREE.Mesh constructor with one of these meshes.

The following table provides an overview of the meshes that are available in Physijs:

Name

Description

Physijs.PlaneMesh

This mesh can be used to create a zero-thickness plane. You could also use BoxMesh for this together with THREE.BoxGeometry with low height.

Physijs.BoxMesh

If you have geometries that look like cubes, use this mesh. For instance, this is a good match for THREE.BoxGeometry.

Physijs.SphereMesh ...

Get Learning Three.js – the JavaScript 3D Library for WebGL - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.