Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCG clone along up vector

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
650 Views, 4 Replies

MCG clone along up vector

Hi all. I am trying to make a cloner, using MCG, but I am having a problem offsetting the duplicates in the Up vector direction. When placing the MCG in front view the cloned meshes get cloned in the forward vector direction instead. How can I make the cloned meshes go towards the up vector no matter which view I am in?

 

here is my graph so far...

Untitled.png

Tags (1)
4 REPLIES 4
Message 2 of 5
ads_royje
in reply to: Anonymous

Hi @Anonymous,

 

the MCG transforms you are applying are (by default) in Local space.

 

When creating the MCG object from a viewport, like any other primitive, it'll give it a rotation.

For instance, create a Teapot in Front view, it'll be rotated.

Set the MCG object to have rotation x 0.0 instead of rotation x 90.0

 

You could replace the input operator"Identity Matrix" by the input operator "Geometry: Local to World Matrix".
You would get the Matrix in World Space.

 

I hope that can help,

 

 

Message 3 of 5
Anonymous
in reply to: ads_royje

Hi Jean, I still could not get this to work. Firstly, with the local to world matrix node, I could not figure out exactly this node works. If I rotate this matrix, the object still duplicates in the "Y" axis. In addition, I could not find a node that will set the object's rotation to a given value. I see that I can rotate a mesh, but if it is true that the x axis is 90.0, then rotating the mesh by -90.0 does rotate the object, but the object still duplicates in the "Y" axis.

Message 4 of 5
ads_royje
in reply to: Anonymous

Hi @Anonymous,

 

Sorry, you are right, the operator "Geometry: Local to World" does not help you just by replacing Identity Matrix, I should of just loaded the graph first. This operator is indeed intended for transforming to World.

 

In my first proposed way, only the starting Matrix was world, the offset was still local.

The local matrix results (the output of Generate Array of N) has the local Matrix (Identity Matrix) and the offset from Vector that needs to be. 

LocalToWorld.JPG

I've attached a modified versions of your graph (just remove .txt from the file name), that does transform all to World. So no matter the way the MCG object is placed in the scene, it'll always clone in the World coordinates.

 

 

Message 5 of 5
Anonymous
in reply to: ads_royje

@Anonymous,

That did the trick. Thank you so much. Also, could you please elaborate more on why this works? It is kind of confusing when you have mentioned that by default, object creation is placed in local space, but you have first converted the matrix to world space and then reversed the matrix back to local space. Isn't it true that by placing an inverse matrix node it switches the world space matrix back to local space?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report