天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 6|回复: 0

视图比例

[复制链接]
  • TA的每日心情
    开心
    昨天 15:23
  • 签到天数: 69 天

    [LV.6]常住居民II

    410

    主题

    167

    回帖

    2704

    积分

    管理员

    积分
    2704
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    void getViewXform(const AcGePoint3d& target,
    const AcGeVector3d& viewDir,
    const double& twist,
    AcGeMatrix3d& xform)
    {
    AcGeVector3d vZ = -viewDir;
    vZ.normalize();
    AcGeVector3d vX = -vZ.perpVector().rotateBy(twist, vZ);
    AcGeVector3d vY = vX.crossProduct(vZ);

    xform(0,0) = vX.x; xform(0,1) = vX.y; xform(0,2) = vX.z;
    xform(1,0) = vY.x; xform(1,1) = vY.y; xform(1,2) = vY.z;
    xform(2,0) = vZ.x; xform(2,1) = vZ.y; xform(2,2) = vZ.z;
    xform(3,0) = 0; xform(3,1) = 0; xform(3,2) = 0;

    AcGeVector3d targ = target.asVector();
    targ.transformBy(xform);
    xform(0,3) = -targ.x;
    xform(1,3) = -targ.y;
    xform(2,3) = -targ.z;
    xform(3,3) = 1;
    }




    void getViewXform(const AcGePoint3d& target,
    const AcGePoint3d& position,
    const AcGeVector3d & upVec,
    AcGeMatrix3d& xform)
    {
    AcGeVector3d vZ = (target - position).normalize();
    AcGeVector3d vY = upVec;
    AcGeVector3d vX = vZ.crossProduct(vY);

    xform(0,0) = vX.x; xform(0,1) = vX.y; xform(0,2) = vX.z;
    xform(1,0) = vY.x; xform(1,1) = vY.y; xform(1,2) = vY.z;
    xform(2,0) = vZ.x; xform(2,1) = vZ.y; xform(2,2) = vZ.z;
    xform(3,0) = 0; xform(3,1) = 0; xform(3,2) = 0;

    AcGeVector3d targ = target.asVector();
    targ.transformBy(xform);

    xform(0,3) = -targ.x;
    xform(1,3) = -targ.y;
    xform(2,3) = -targ.z;
    xform(3,3) = 1;
    }




    void getProjXform(const double& dcsWidth,
    const double& dcsHeight,
    const double& cam2targDist,
    bool isPersp,
    AcGeMatrix3d& xform)
    {
    xform AcGeMatrix3d::kIdentity;

    xform(0,0) = (double(2)) / dcsWidth;
    xform(1,1) = (double(2)) / dcsHeight;

    if (isPersp)
    {
    xform(2,2) = xform(3,2) = (double(1)) / cam2targDist;
    }
    else
    {
    xform(2,2) = (double(0.1)) / cam2targDist;
    }

    }




    void getScrXform(int scrWidth,
    int scrHeight,
    bool isPersp,
    AcGeMatrix3d& xform)
    {
    xform = AcGeMatrix3d::kIdentity;

    xform(0,0) = xform(0,3) = (double(scrWidth)) / (double(2));
    xform(1,1) = xform(1,3) = (double(scrHeight)) / (double(2));

    if (isPersp)
    {
    xform(2,2) = 3276.75;
    xform(2,3) = 62258.25;
    }
    else
    {
    xform(2,2) = xform(2,3) = 32767.5;
    }
    }




    void getWcs2ScrXform(const AcGeMatrix3d& viewXform,
    const AcGeMatrix3d& projXform,
    const AcGeMatrix3d& scrXform,
    AcGeMatrix3d& xform)
    {
    xform = scrXform * projXform * viewXform;

    if ((xform(3,3) != double(1)) &&
    (xform(3,3) != double(0)))
    {
    const double scale = (double(1))/(xform(3,3));

    xform(0,0) *= scale;
    xform(0,1) *= scale;
    xform(0,2) *= scale;
    xform(0,3) *= scale;

    xform(1,0) *= scale;
    xform(1,1) *= scale;
    xform(1,2) *= scale;
    xform(1,3) *= scale;

    xform(2,0) *= scale;
    xform(2,1) *= scale;
    xform(2,2) *= scale;
    xform(2,3) *= scale;

    xform(3,0) *= scale;
    xform(3,1) *= scale;
    xform(3,2) *= scale;
    xform(3,3) = double(1);
    }
    }

     

     

     

     

    视图比例
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|

    GMT+8, 2024-7-1 05:10 , Processed in 0.063522 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表