Notifications
Clear all
[Closed] pivot problems in the sdk
Aug 05, 2015 5:56 pm
I thought I might if had this working. But no -sigh
It looks to me moving my pivot sometimes if the object is not scaled. Then its a mess.
I’m I doing this right?
Box3 bb;
ViewExp& vpt = ip->GetViewExp(NULL);
for( auto i = 0; i < ip->GetSelNodeCount(); i++){
INode *newnode = ip->GetSelNode(i);
Object *obj = newnode->GetObjectRef();
obj->GetLocalBoundBox(ip->GetTime(), newnode, vpt.ToPointer(), bb);
Point3 theBox(bb.pmin.x, bb.Center().y, bb.Center().z );
Matrix3 mat(1);
newnode->ResetPivot(ip->GetTime());
newnode->Move(ip->GetTime(), mat, theBox, TRUE, FALSE, PIV_PIVOT_ONLY, FALSE);
newnode = NULL;
}
ip->RedrawViews(ip->GetTime());
I guess what I’m after is the c++ way to …
obj.pivot = [obj.min.x, obj.center.y, obj.center.z]
thanks for any thoughts on this
5 Replies
1 Reply
Aug 05, 2015 5:56 pm
Ok, good to know.
The problem I have is if the object is in great shape it works fine. But if the object has been scaled, it moves the object far of the screen.
From the above code Am I missing something?
Aug 05, 2015 5:56 pm
bounding box is local, transform matrix is in world coordinate system. you have to pick one but the same axis system.