Back to Forum
Dispose Method - THREE.js
harp34 posted 5 years ago

What does the dispose method do?

gui.add(world.plane, 'width', 1, 20).onChange(()=>
{
  // remove all planeGeo width values
  planeGeo.geometry.dispose();

  console.log(planeGeo.geometry)

  
})

When I print this out via console, nothing is disposed(removed), I see that width is still as it was created:

parameters: {width: 5, height: 5, widthSegments: 10, heightSegments: 10}
type: "PlaneGeometry"
A
A1010 posted 5 years ago

Dispose basically means delete.

Want to participate?

Create a free Chris Courses account to begin

Providing the lift to launch your development career

© 2026 Chris Courses. All rights reserved.