UG二次开发,UFUN 单体从一个向量旋转到另外一个向量

bool RotateBody( tag_t rotaBody, double fromVec[3], double targVec[3],double rotaOri[3]) 
{
  
    double commPerp[3];
    double angle = 0;
    double romatrixb[12];
    int rotstatus = 0;
    UF_VEC3_cross(fromVec, targVec, commPerp);
    UF_VEC3_angle_between(fromVec, targVec, commPerp,&angle);
    double roangle = (angle * 180 / 3.14159265358979323846); 
    int n_obj = 1;
    int move_cope = 1;
    int dest_layer = 0;
    int  trace_curves = 1;
    int status = 0;
    tag_t moveTag = NULL_TAG;
    tag_t trace_curve_group = NULL_TAG;

    if (angle>0)
    {
        FTN(uf5945)(rotaOri, commPerp, &roangle, romatrixb, &rotstatus);
        FTN(uf5947)(romatrixb, &rotaBody, &n_obj, &move_cope, &dest_layer, &trace_curves, &moveTag, &trace_curve_group, &status);
    }
    if (status == 0 )
    {
        return true;
    }
    else
    {
        return false;
    }    
}
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值