three-instanced-group-mesh
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

three-instanced-group-mesh

Downloads Version License

Instanced Group Mesh support for three.js

Motivation

Three.js supports instancedMesh which is a high performance way to render a large number of meshes with the same geometry and material.

But sometimes the model which needed to be instanced can be a complex group rather than a single mesh. This plugin can helps you easily instancing a complex group of meshes.

NOTE: Object type other than Mesh (like Light, Camera, etc) in the given group will be ignored when instancing

Compatibility

Compatible with three.js with instancedMesh supports, aka r110 and above

Install

$ npm install three-instanced-group-mesh

Usage

Just like THREE.instancedMesh

ES Module

import InstancedGroupMesh from "three-instanced-group-mesh";

const instancedGroupMesh = new InstancedGroupMesh(group, count);
instancedGroupMesh.setMatrixAt(index, matrix)

Browser

<script src="https://unpkg.com/three/build/three.js"></script>
<script src="https://unpkg.com/three-instanced-group-mesh/dist/THREE.InstancedGroupMesh.min.js"></script>
<script>
  const instancedGroupMesh = new THREE.InstancedGroupMesh(group, count);
  instancedGroupMesh.setMatrixAt(index, matrix)
</script>

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i three-instanced-group-mesh

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

42.1 kB

Total Files

16

Last publish

Collaborators

  • troy351