Modifier Vertex Rotation Matrix...

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 02 February 2013   #1
Modifier Vertex Rotation Matrix...

OK, best shot at explaining this.

I have a modifier that is projecting verts to the surface of another object and I want to rotate the projected mesh to align to the surface.

I have fired a ray at the surface (Hit). I use the hit.pos to get a distance to move all the vertices down to the surface. This works just fine but the object is not oriented to the surface.

From the hit.dir I build a rotation matrix and now want to rotate all the verts in the mesh to be aligned to the surface. I have been messing around with multiplying one TM to another for hours trying to find the right combination thinking I knew exactly what was needed.

Multiplying the verts position by the rotation doesn't work as it is not in the right space. The rotation is there but the hit is not in the correct location any more.

What is the correct order to do this.

I have these matrix values.

objTm --Objects transform that is being projected.
rotTm --Rotation matrix built from the hit using the hit.pos as the position
vTm --Vertices matrix (transMatrix p)

What the hell am I missing. Any order that I have tried has not worked.

Any suggestions?
Paul Neale
Old 02 February 2013   #2
Are you getting the transformation matrix of the modifier to use that in context of the operation? More info on that in the help here.

"The Evil Monkey hiding in your closet."
Old 02 February 2013   #3
My modifiers TM is an identity matrix. That doesn't change. Good thought but I have not managed to get that to help me at all. I can get the rotation right without position and I can get position right without rotation.

Paul Neale
Old 02 February 2013   #4
I got it, I don't get why I got it how ever:( Well I do sort of but it doesn't feel right again. But it works!
Paul Neale
Old 02 February 2013   #5
Spoke to soon. Only works when projection object is orientated to world space:(
Paul Neale
Old 02 February 2013   #6
have a look in the sdk.... samples particle flow the source code should be there for surface emitter

the core routines are actually in the file


Last edited by Klunk : 02 February 2013 at 05:39 PM.
Old 02 February 2013   #7
Oh nice. Hadn't seen those. Thanks.
Paul Neale
Old 02 February 2013   #8
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:06 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.