
Mon, 03/12/2007 - 18:40
Forums:
I rotate a shape with gp_Trsf.SetRotation(). The first around Y and the second around X. The problem is that the second rotation seem rotate around an X axes in a rotated coord. system, not the original X axes. How can I rotate around the original X axes ?
gp_Trsf aTrsf1,aTrsf2;
aTrsf1.SetRotation(gp::OY(),.7);
aTrsf2.SetRotation(gp::OX(),.2);
gp_Trsf FTrasf = aTrsf2 * aTrsf1;
BRepBuilderAPI_Transform aBRepTrsf(aPrism, FTrasf);
aNewPrism = FTrasf.Shape();
Mon, 03/12/2007 - 20:42
Try reversing your dot product. I think you will see the desired result:
gp_Trsf FTrasf = aTrsf1 * aTrsf2;
Wed, 03/21/2007 - 20:42
Perform both rotations independantly like this...
gp_Trsf aTrsf1,aTrsf2;
aTrsf1.SetRotation(gp::OY(),.7);
aTrsf2.SetRotation(gp::OX(),.2);
BRepBuilderAPI_Transform aBRepTrsf(aPrism, aTrsf1);
BRepBuilderAPI_Transform aBRepTrsf(aPrism, aTrsf2);
aNewPrism = aBrepTrsf.Shape();
Hope this solves your problem