Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to create AABB tree for dynamic mesh?

  • You cannot reply to this topic
5 replies to this topic

#1 Twerdster   Members   -  Reputation: 119


Posted 04 July 2014 - 09:22 AM


I am trying to design a program for mesh to mesh collision detection and response for clothing simulation.


Mesh A is an avatar with polycount of around 2k.

Mesh B is a triangle mesh representing a piece of clothing with around 6k triangles.


My avatar mesh is deformed using linear blender skinning and wont be influenced by the clothing mesh.


I have some questions regarding this scenario:

1) Is an AABB tree well suited to this problem?

2) If I detect only cloth triangle collisions against the AABB tree for the avatar then 

what is the best way to update the AABB tree for the avatar every timestep?

3) Is it even necessary to update? Could I just rebuild the AABB tree every frame for the Avatar?  Is that a good way of doing it

or will it kill my framerate.

3) I dont intend to use OpenCL or CUDA for this. Are there any GPGPU methods for this kind of interaction

using only OpenGL?


Any help will be greatly appreciated!




#2 Jason Z   Crossbones+   -  Reputation: 4716


Posted 05 July 2014 - 02:27 PM

I haven't ever done a similar topic, so this is just my gut feeling.  I would say to use a simplified version of your cloth and just create an AABB from that, rather than using the full thing.  For that type of interaction, you just want to detect when the contact is made, then you can switch to a more detailed calculation when it is detected.


Can you post an image of what you are trying to do?  It sounds like an interesting scenario :)

#3 Randy Gaul   Members   -  Reputation: 304


Posted 06 July 2014 - 02:51 PM

edit -- misunderstood the OP

Edited by Randy Gaul, 06 July 2014 - 02:52 PM.

#4 Twerdster   Members   -  Reputation: 119


Posted 06 July 2014 - 04:51 PM

To claify a little bit:


The cloth is a general triangular mesh. The simulation is physics based using verlet integration (easily swapped).

I want to create an AABB tree for the avatar and then find collisions of the cloth vertices with the avatar and 

am not interested in cloth self collision (currently). 

If the avatar was static then this wouldnt be a problem and I wouldnt need to ask anything.

However the avatar is dynamic because its mesh is deformed by a skeleton using linear blend skinning.

So this means that the AABB tree I build will need to be updated or rebuilt every frame.

I want to know where I can find a good reference for updating the AABB tree or if its not even worth it for

2-4k triangles and maybe its just better to rebuild it. Is this the right approach? What are the alternatives?

#5 kalle_h   Members   -  Reputation: 1278


Posted 07 July 2014 - 05:03 AM

Just approximate every character bone with sphere(our couple) and do bruteforce test.


#6 Twerdster   Members   -  Reputation: 119


Posted 07 July 2014 - 03:13 PM

@kaelle_h: Thank you. I went to the link you put and got lost in a world of awesome. Apart from the cloth idea everything on that site is mindblowing.