Aligning boxes rotation to face a object
I am attempting to create a script which will create a row of boxes, going from one point to another(both chosen objects).
The (first) attachment shows what I have at the moment, and the second(manually rotated) shows what I'm trying to get(the reason the boxes aren't inbetween the two boxes, but offset is because the pivot is still in the center, not at the end).
I have managed to get the positions correct, but haven't been able to get proper rotations.
Any help would be appreciated, I have been trying for a while, and havent managed to get a properly working result.
Edit:
I have also tried using a look at constraint, but haven't been able to transfer the objects rotation to the others, and I don't want to add the constraint to every box.
Attachment | Size |
---|---|
problem1.png | 17.23 KB |
problem2.png | 19.14 KB |
Comments
Something like this would be
Something like this would be a way, of course this is just one of many solutions and probably the most stupid one, but good as a starting point nonetheless.
Some of my scripts and MCGs :: 3ds Max SDK Intro for Scripters
Thanks! It works well (only
Thanks! It works well (only had to change round the x & y(the boxes were overlapping)), Im not that knowledgeable with stuff like this so thanks again.