...

/

Functions and Attributes for Meshes

Functions and Attributes for Meshes

Learn how to transform a mesh using different properties.

Mesh properties

We’ve already learned that to create a mesh, we need a geometry and one or more materials. Once we have a mesh, we add it to the scene and it’s rendered. There are a couple of properties we can use to change where and how this mesh appears on the scene. In our first example, we’ll look at the following set of properties and functions:

  • position: This determines the position of the object relative to the position of its parent. Most often, the parent of an object is a THREE.Scene object or a THREE.Group object. 

  • rotation: With this property, we can set the rotation of an object around any of its own axes. Three.js also provides specific functions for rotations around a single axis: rotateX(), rotateY(), and rotateZ()

  • scale: This property allows us to scale the object around its xx-, yy-, and zz-axes.

  • ...