Closed linson7017 closed 10 months ago
I found i have made a mistake. I should use the vertex data before initialization when create sdf and use local vertex data when add cubic sdf collision object.
The reason for this is that the SDF is computed in the reference configuration of the bunny and during runtime each query vertex is transformed to this reference configutation. So the SDF never changes. Moreover, since we use an SDF of a geometry for all instances of this geometry, this has to be in an independent coordinate system. So all bunnies of a scene just share one SDF.
I tried to study how cubic sdf works by rendering sdf while simulating. I found that If rigid was initialized with no translation and scale, i can get a reasonable result. However when i changed the initial position, rotation or scale, i got an unexpected sdf rendering. But the collision detection had no problem. I did not know what happen behind the cubic sdf detection. Without any initialization With initial position With initial rotation
This is my rigid initialization code
My understanding of sdf rendering is to transform the world pos inside aabb to local pos and draw point with negative sdf value calculated by collision object. Why cubic sdf collision object give an unexpected result! Any one knows why. Thanks!