Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 6 Current »

Overview

BufferGeometry is an amazing feature of Three.js, however it can be rather daunting to tackle putting it together yourself for the first time. This article is intended to break it down into different components, and explain each piece with (hopefully) enough detail that you'll get a decent grasp of how to customize this for yourself.

Attributes

A BufferGeometry has attributes which define it's fivemain areas of concern:

  • Position
  • Normal
  • UV
  • Color
  • Index

Position

Position is an object which holds an array of positions and ....

bufferGeometryInstance.attributes.position = {
	array: mesh.positions,
	itemSize: 3
};

Normal

bufferGeometryInstance.attributes.normal = {
	array: mesh.normals,
	itemSize: 3
};

UV

bufferGeometryInstance.attributes.uv = {
	array: mesh.uvs,
	itemSize: 2
};

Color

Index

 

Step-by-step guide

 

Filter by label

There are no items with the selected labels at this time.