Jump to content

inverse matrix for crowd agents orientation quaternion


Recommended Posts

I'm working on a simulation that has some crowd agents following a terrain using its normals as the up vector (for simplicity we can assume the terrain is a sphere).  I've got my base simulation setup working fine, but in one case the sphere is moving really fast through the scene in world space.  On certain frames where the terrain is moving extremely fast the crowd agents basically can't calculate the next frame so there positions end up being 'Nan' or undefined and they disappear.

I tried running the simulation with up to 50 substeps, and that improves how many agents survive to the end of the simulation a bit, but still about half of them are still lost by the end of the sim.

in order to combat this i managed to create a point vop that creates a transformation matrix from a tracked maya rivet/locator on the sphere.  Then I applied the inverse matrix transformation to freeze the sphere at the origin to run the simulation.

After the simulation is done, I'm able to re-apply the transformation matrix to the sphere to get it back to the correct spot.

However, when I try to apply the matrix to the crowd agents, their final positions look correct, but their orientations are wrong.  I believe the orientation attribute is the quaternion for all the agents rotations?  Any ideas on how I would go about getting the agents to re-align correctly again after the simulation has been run?

baking down the agents geometry and then applying the transformations seems to work, but this approach is really slow because of the amount of geometry it has to process, makes it quite difficult to iterate.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...