Point Cloud System Bug?

Demo:
https://playground.babylonjs.com/#0F8FL2#8

Context:
I’ve been pulling my hair out over some nonsensical PCS behavior in my implementation. I think I’ve narrowed it down to what’s happening in the playground above. I’ve tried to simplify the code, and would like to understand how the heck PCS actually places surface points on a mesh. I’m new to BabylonJS, but this just doesn’t seem intuitive. Maybe I’m missing something here?

Bug(?):

  1. I have a sphere mesh in 0,1,0 world space.
  2. Every 2 seconds I create a new PCS and add surface points to the mesh.
  3. For the first PCS, the surface points show up in the right spots (the sphere’s surface centered on 0,1,0 world space).
  4. But every subsequent new PCS with additional surface points leads to surface points somehow translating up?
  5. :dizzy_face:

Thanks in advance for the help!

I like the title of your playground :slight_smile:

It seems like the vertex data of the original mesh is being changes every time you initialize PCS. we will have to check that. Here is another fun playground - wtf | Babylon.js Playground (babylonjs.com)

2 Likes

PR:

3 Likes

@RaananW @Evgeni_Popov Wow, thanks for the super quick turnaround folks! :smiley: Really appreciate how active the community is.

1 Like

Same thing with rotation of the mesh for me. So probably also scale.

This was resolved already, so I am not quite sure what you are referring to?

Oh, is this supposed to be fixed already? I’m expieriencing this bug still. I fixed the translation part by positioning my surface mesh at 0,0,0 but I also rotate it by 180 degrees in the beginning, resulting in the PCS to rotate by 180 as well for every iteration.

can you reproduce that on the playground?

Took a bit to strip down the scene to the essentials. Press S to start the PCS.

https://playground.babylonjs.com/#X3UJBQ

The fix is not deployed yet. You should wait for the next nightly (will be done today).

1 Like

good to hear!

Hi,

I’m still experiencing the bug, but I saw there was a update today, is this supposed to still be an issue?

Additionally I’m also not getting the correct values for the vectors of the bounding box of the transformed mesh: https://playground.babylonjs.com/#X3UJBQ#2 (Here I’m drawing my own bounding box with a linesystem)

The normal bounding box moves/rotates/scales with the original mesh but doesn’t update mesh.getBoundingInfo().boundingBox.worldVectors?

It does work for me, but I had to clear the cache first (CTRL+F5).

You need to compute the world matrix as it is not up to date yet after loading time:

Haha astounding! Cache did the trick. And thank you for your help with the bounding box :slightly_smiling_face: