HowTo : Changing the extrusion vector of a vdInsert then the vdAttrib objects do not change
Article | 60001656 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 3/22/2012 |
Submitted by | Mark Seguin |
Keywords | |
Subject
Changing the extrusion vector of a vdInsert then the vdAttrib objects do not change
Summary
If i changing the extrusion vector of a vdInsert then the vdAttrib objects do not change. How can I do this and also change the vdAttributes ?
Solution
This is an expected behavior. You need to change the “direction” of the vdInsert as the vdInsert’s extrusion vector property doesn't change the extrusion vector of the attributes that are referenced by the insert. Instead use the Rotate3D method of CommandAction or a code like :
VectorDraw.Geometry.gPoint pt = new VectorDraw.Geometry.gPoint(ins.InsertionPoint);
VectorDraw.Geometry.Matrix mat = new VectorDraw.Geometry.Matrix();
mat.TranslateMatrix(-pt.x, -pt.y, -pt.z);
mat.ApplyECS2WCS(new VectorDraw.Geometry.Vector(1, 0, 0));
mat.TranslateMatrix(pt.x, pt.y, pt.z);
ins.Transformby(mat);
ins.Update();
ins.Invalidate();