Jump to content
Developer Wiki and Function Reference Links ×

Move 3D by reference to a specific working plane

Recommended Posts

Hi guys


Easy to move a specific object in 3D through marionette.


You provide a vec3 input to a Move Nove and there it goes.


But how to move the object according to a specific Working plane? Or the current working plane?


Could you please help?



Link to comment

GetPlanarReference will get you a RefID to identify the plane an object is on.

SetPlanarReference will allow you to use a RefID to put an object onto a specified plane, but it's coordinates will be transformed so it does not move in 3D space.

Transform2 or Move should allow you to specify a Vector to move the object along the plane it is on.



Link to comment

Thank you pat.


I uploaded you a video of the routines I am trying to replicate with marionette.


It seems transform2 nodes could be something useful for me. I think maybe it will help me produce a 2D vector in the plane normal to my selected face and move my object along this plane. I will try it later.


The move node is efficient but I am not able at now to understand how to convert the move vector in the plane B (move along z axe in the plane planar to the pyramide face ) to the precise move in the 3D Coordinates of the origin ( with appear to me to be the move3D coordinate system )


I thought I will find an option in the move3D node to move in the Layer coordinates or in the working plane like in the move3D palette but it's not the case.


Thanks for your help.








Link to comment

Struggling with the math inside the marionette custom node.... I think I am lost in my cos and sin transformations...


    #valeur ci dessous pour essais entrée sortie à enlever à la fin
    x = v*((math.cos (math.radians (rotAng[2])))*(math.cos (math.radians (rotAng[1])))*(math.cos (math.radians (rotAng[0]))))
    y = v*((math.cos ((math.sin (math.radians (rotAng[1])))*(math.cos (math.radians (rotAng[0]))))
    z = v*((math.cos (math.radians (rotAng[2])))*(math.sin (math.radians (rotAng[1])))*(math.cos (math.radians (rotAng[0]))))

Link to comment
  • 2 weeks later...

Did not looked into your code details because i keep that theme for a time from my brane. 
I think the general we can take an objects entity matrix and set that entity matrix to another object. With Set- and get Entity Matrix. This is not really hard. What was always the point is, that having some points in 3D which defines a plane transferring to an entity matrix wen need for the SetEntityMatrix Script command. 

What i have so far in that direction:
1. A way to have 3 points and gets an VW entity matrix of 3 points. Somehow my code os spreaded over a bigger code so i do now know if exactly that works in your example. code and functions i needed there code snippeds.

I would say the code here took me several hours of figuring out that easy looking code. But i think at the end it maybe needs just a few lines if it was optimated. Also the vs.Vec2Ang() solves a lot. It would be hard to find out in which quadrant the plane is oriented and the direction of the points etc..

Like i told, not looked yet into your code. This snipped worked here for getting rotation matrix from 3 points. Not sure, if it works in all directions and for vertical planes in every situation. I always thought there must be a general solution for that. And there is but on the other side we must fit it to the vw SetEntity matrix also the plane matrix are different from the rotation matrix. 


2. Getting a centroid and a plane. With that we can project points on that plane (not a vw plane, a plane defined by the normal matrix of the custom getPlane Node in that example). Here:

At one point everything is turning into hard work. But we still have fun 🙂


Link to comment

The vectors can be determined with three points. The rotation angles around the two axes X&Y can then be calculated from the vectors.

In the case of a pyramid, these can be two corner points and the top.




Link to comment

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...