SPS with 3d models is possible?

Hi, im trying to create multiple instances of a 3d model, so is it possible to SPS for such purpose? If yes, could anyone give me a sample PG?

then one im trying to work - PG - https://playground.babylonjs.com/#U5SSCN#225

@JohnK Hi John, Could you help?

See Solid Particle System | Babylon.js Documentation (babylonjs.com), Cloning With the Solid Particle System | Babylon.js Documentation (babylonjs.com). It is possible to use any kind of mesh as the SPS particle, your PG is passing something that is not a mesh to it. If you want to use the return function of loading the mesh, I recommend using ImportMeshAsync like here: Loading Any File Type | Babylon.js Documentation

There are several errors in your PG

Your SPS code will be executed before your model is loaded. The code needs to be inside the the SceneLoader.

You have not used Append correctly.

See Loading Any File Type | Babylon.js Documentation

Here is a PG that nearly works

The problem is that SPS does not handle models with a parent, only the parent is added and in this case newMeshes[0] is an empty mesh. GLB models are always added a root parent to deal with right handed system.

Here is one using .babylon format

3 Likes

Sure, understood, thank you :slight_smile:

can .dae file type can be treated as the same? - .dae files can be loaded? Im getting a console error!

i tried with around 1000 numbers(SPS) and it started crashing. so using 2d will the apt workaround right? or anyother way to fix it?

Do not know about .dae files

1 Like

You might be better of creating a simple pallet with boxes directly in Babylon.js to cut down on vertices. Or even use one box with a pallet texture.

check out opacity

and Troubleshooting Solid Particle System Transparency Issues | Babylon.js Documentation

[quote=“JohnK, post:9, topic:32879”]
You might be better of creating a simple pallet with boxes directly in Babylon.js to cut down on vertices.
[/quote]. how to achieve this? and can you explain ‘vertices’?

This is to explain vertices I am not suggesting you build a custom mesh.

For pallet make three boxes on top, two underneath and merge the meshes.
Texture with wood.

Or try the one box option with opacity.

3 Likes

Thank you @JohnK :slight_smile: