Matrix Collision Maya

Matrix Collision Maya

A few days ago I uploaded a small video showing a test to calculate collisions.


So this is the set up. How does it work?

I. INTRODUCTION

The first thing I decided when starting this setup was that I was not looking for a constraint to a geometry, I wanted the ability to be able to move on it or to be able to move away at any time.

That means that we will be calculating the distance we are from the geometry during all the time to make a blend between the main control or the attached position

No hay texto alternativo para esta imagen

II. RIG SYSTEM

As first of all we will have to get the point closest to the control in relation to the geometry and take a matrix from it.

To do that we will use the "closetPointOnMesh" to collect that position from the "offsetCollision"


Now we need to get the rotation,for this we will use two "vectorProduct" nodes in "cross" mode.

One of the vectors will be for our Upvector so we will need a cross between our normal and set to 1 the second input that we requier as Upvector.

The other vector will be a cross product between the normal and the Upvector .

Once calculated our matrix we would have what is the exact point of the geometry but we need the Point of "offset" between the geometry and our control so for this we will create a "multMatrix" where we will connect the matrix that gives us our "fourbyFourMatrix" and the "inverseMatrix" of our "offsetControl"


No hay texto alternativo para esta imagen


To conclude we will have a "pairblend" to calculate which matrix is the one that commands

  1. Our input1 will be the main Control
  2. the weight is a simple conditional with the translate of the matrix(It would be our distance from the point to the control)

if it is greater than 0 it will be moved by the mainControl and if not it will stay "stuck" to the geometry

Our Input 2 we will require some calculations

we must create a "multmatrix" between our matrix and the WorldMatrix of our Main control,

We do this so that it denies its transformation and the target stays "stuck" to the geometry


III. CONCLUSION

Once all this is done we will have our "geometry constraint collision" working.

When we are on top of the geometry we will take the values of the matrix that we have created and once we move away the command will change to our main control

要查看或添加评论,请登录

"PepeRig" Jose Lozano的更多文章

  • Aim Constraint with nodes

    Aim Constraint with nodes

    INTRODUCTION With the extra time in this pandemic I have taken the opportunity to start optimizing my rigs. The first…

    2 条评论

社区洞察

其他会员也浏览了