View Full Version : Scale an object like in Model tool not in Object tool, with coffe.. How?
indeep 03-21-2010, 07:38 PM How is posible to Scale an object like in Model tool not in Object tool, with coffe
With SetScale() we just set as in Object tool
|
|
Scott Ayers
03-22-2010, 06:32 PM
Give this a shot: // This script scales an object by it's point array
var c = doc->FindObject("Cube");
var points = c->GetPointCount();
var pointArr = c->GetPoints();
// To scale down set scale to value less than 1
// To scale up set scale to value more than 1
var scale = 1.5;
var i;
for(i = 0; i < points; i++) // grabs all the points of the object
{
pointArr[i] = pointArr[i] * scale;
}
c->SetPoints(pointArr);// set the changed point positions
op->Message(MSG_UPDATE); // make sure it happens
-ScottA
CGTalk Moderation
03-22-2010, 06:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.