If you don’t need precise triangle collisions (for a box not relevant anyway) you can just use a simple bounding box check such as.
const box = new THREE.Box3;
box.expandByScalar( 50 ); // your box size, goes -50 for min and +50 for max so a 100x100x100 box
// in your loop for checking particles
if ( !box.containsPoint( particlePosition ) )
// do something
Depending on what you want to happen you could “kill” the particle going outside or just inverse the position so it wraps around the box, or reflect the particle off the box sides by it’s velocity vector, whatever you prefer.
I’m sorry, I’m still very new at absolutely everything. So I’ve been able to use the expandByScalar. I cannot seem to make the particles inside of the box move even with this technique.
Do you know of any examples or tutorials to show me quite what you mean?
Sorry i thought you wanted to know how to restrict them to move only inside a box. There are quite a lot examples about particles, just try the search in this forum or google, there are different approaches for different cases you can find what fits your needs.