Jump to content
7erra

attachTo and selection points

Recommended Posts

Hi everyone!

 

So I'm trying to get the relative offset of an object to use it for the attachTo command. You can return the relative model position with

TER_3den_baseObject worldToModel (TER_3den_attachObject modelToWorld [0,0,0])

But how does it work together with a selectionPosition?

Here is a graphic demonstrating the problem:

HIpG1ue.png

Share this post


Link to post
Share on other sites

The vector from "selectionPosition" to "worldToModel" is the difference between them:

For example:

_attachPoint = OBJECT selectionPosition "SELECTION"; // Vector from OBJECT center to selectionPoint
_worldToModel = OBJECT worldToModel(ATTACHMENT modelToWorld [0,0,0]); // Vector from OBJECT center to ATTACHMENT center
_offsetFromSelection = _worldToModel vectorDiff _attachPoint; // Vector from selectionPoint to ATTACHMENT center

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×