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 3ds® Max® / SDK / Align Pivot point to another objects (SOLVED)
  RSS 2.0 ATOM  

Align Pivot point to another objects (SOLVED)
Rate this thread
 
63675
 
Permlink of this thread  
avatar
  • Laurence
  • Posted: 19 January 2012 06:36 AM
  • Total Posts: 4
  • Joined: 16 December 2006 05:11 PM

Hi, I need to align a nodes Pivot point to that of another node. How can this be done?
There is a function Move() in INode that allows for the movement of pivot points only, but I am unsure of how to use it, specifically how to tell it which axes to move along. The following is my attempt at using it, where shapeDif is the point3 difference between the two node’s pivots.

Point3 translateXYZ(1,0,0);
 
Matrix3 Axe;
 
Axe.SetTranslate(translateXYZ);
 
shapeNode->Move(tAxeshapeDiffalsetruePIV_PIVOT_ONLY);
 
translateXYZ.x=0;
 
translateXYZ.y=1;
 
translateXYZ.z=0;
 
Axe.SetTranslate(translateXYZ);
 
shapeNode->Move(tAxeshapeDiffalsetruePIV_PIVOT_ONLY);
 
 
translateXYZ.x=0;
 
translateXYZ.y=0;
 
translateXYZ.z=1;
 
Axe.SetTranslate(translateXYZ);
 
shapeNode->Move(tAxeshapeDiffalsetruePIV_PIVOT_ONLY);

Move function ref. in sdk docs: http://download.autodesk.com/glo...a78f0d77df63620d5b378795b

any help would be greatly appreciated.
thanks

EDIT:
Was just a small case of sending the shapeDif with 0’s in axes that wasn’t being moved:

Point3 translateXYZ(1,0,0);
 
Matrix3 xAxe;
 
Point3 shapeDifBU shapeDif;
 
shapeDif.0;
 
shapeDif.0;
 
xAxe.SetTranslate(translateXYZ);
 
shapeNode->Move(txAxeshapeDiffalsetruePIV_PIVOT_ONLY);
 
translateXYZ.x=0;
 
translateXYZ.y=1;
 
translateXYZ.z=0;
 
shapeDif shapeDifBU;
 
shapeDif.0;
 
shapeDif.0;
 
xAxe.SetTranslate(translateXYZ);
 
shapeNode->Move(txAxeshapeDiffalsetruePIV_PIVOT_ONLY);
 
 
translateXYZ.x=0;
 
translateXYZ.y=0;
 
translateXYZ.z=1;
 
shapeDif shapeDifBU;
 
shapeDif.0;
 
shapeDif.0;
 
xAxe.SetTranslate(translateXYZ);
 
shapeNode->Move(txAxeshapeDiffalsetruePIV_PIVOT_ONLY);


Replies: 0