Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Problem Pivot aligning, aim constraint etc.
  RSS 2.0 ATOM  

Problem Pivot aligning, aim constraint etc.
Rate this thread
 
38219
 
Permlink of this thread  
avatar
  • Location: Sao Paulo
  • Total Posts: 1
  • Joined: 08 September 2008 06:46 PM

Hey guys,

I am writing a script that takes two triangles (as separate objects and aligns the pivot and rotation to an edge. Kinda like this:

____2
/_\ /
1

So basically it was like the triangles were one shape and the faces were detached. The flow of the script is the following:

a) Gets the pivot from triangle 1
b) Gets center of each edge of triangle 2
c) Compares them to see which edge is closer
d) Places a locator on a vertex of the closes edge
e) Creates a null and aimconstrain it to the locator
f) Parents triangle 2 to this new group
g) Freezes tranforms on triangle 2

In the paper looks ok, but its kind of working 50-50. It does the right thing 50% of the times. When it goes wrong, it is slightly off about 20 degrees. and even, if I manually create a group and aim it to the locator created, still is wrong on some cases. any clues?

By the way, i even tried a non constrain solution: I discovered the euler angles comparing the edge vector to 1 0 0 (axis). and the applied the transforms to a null group with the same pivot position as the edge. STILL it gives me wrong results.

Am I doing the worng procedures? Is there another approach to it? thanks, and happy new year!



Daniel Moreno
http://www.danmoreno.com
+55 (11) 8558-7774

Replies: 0
avatar
  • THNKR
  • Posted: 30 December 2009 03:56 AM

I’m not sure that I understand what it is you’re trying to do, but perhaps this is helpful:

User Guide > General > Basics > Transforming objects > Transform objects and components > Transform along different axes



Replies: 0