AcGeMatrix3d 读后感

      AcGeMatrix3d是ArxObject开发包中Acge模块的一个类,它是对矩阵的实现。

      坐标的空间转换和图形的几何变换中矩阵起着不可缺失的作用,重要的是ArxOjbect提供的矩阵类接口简单易用,与其用一系列的向量运算实现一个复杂的图形转换,倒不如生成一个矩阵把图形变换来得爽。

      我个人认为,矩阵的精华函数是setToProjection和setToAlignCoordSys,只要灵活运用这两个函数,足以实现矩阵支持的所有仿射变换。

 

 

详细注释

AcGeMatrix3d  &setToProjection(const AcGePlane& projectionPlane, const AcGeVector3d& projectDir);

projectionPlane Input projection plane
projectDir Input projection direction :
Sets this matrix to the matrix of parallel projection into the plane projectionPlane. The direction of the projection is defined by the vector projectDir.
Returns the reference to this matrix.
和:
AcGeMatrix3d  &setToAlignCoordSys(const AcGePoint3d& fromOrigin, const AcGeVector3d& fromXAxis,
const AcGeVector3d& fromYAxis, const AcGeVector3d& fromZAxis,
const AcGePoint3d& toOrigin,
const AcGeVector3d& toXAxis,  const AcGeVector3d& toYAxis,  const AcGeVector3d& toZAxis);

fromOrigin Input origin point of the from coordinate system
fromXAxis Input vector defining the x axis of the from coordinate system
toOrigin Input origin point of the to coordinate system
toXAxis Input vector defining the x axis of the to coordinate system :
Sets this matrix of the matrix which maps coordinate system with the origin fromOrigin and the axes fromXAis, fromYAxis and fromZAxis to coordinate system with the origin toOrigin and the axes toXAxis, toYAxis, and toZAxis
Returns the reference to this matrix

 

        setToProjection实现从点到一个面的投影,不但支持垂直投影,重要的是支持倾斜投影,就是常说的两个平行投影方式,既正交投影。暂不支持透视投影。

       setToAlignCoordSys实现从一个坐标空间(三维中的真实点)到另一个坐标空间的对齐转换。只要定义一个原点和三个向量轴,轴间不管夹角是多少,只要两个坐标空间比例一致,它就能同比例移动过去(按原点坐标),当向量长度不相等时,这时就变成了缩放变形功能。当目标坐标空间和来源坐标空间的轴不一致时,这时就变成了镜像功能。

 

       另外,它提供的平移,旋转,镜像,缩放函数接口也是挺实用的。省去了点和向量运算的麻烦度。

 

成员函数AcGeMatrix3d& setToWorldToPlane(const AcGePlane& plane); 值得一提,生成一个WCS向平面坐标系(此面的参数所描述的UCS)转换的矩阵,如果拿一个点CPoint3d执行此矩阵变换,则变换结果是该点在此平面的二维对应坐标点。 执行结果受面的参数(p,normal)影响。看似按面参数的默认uv搞的。此函数计算模型表面的纹理坐标时常用到。

它没有AcGePoint3d的成员函数AcGePoint2d convert2d(const AcGePlanarEnt& pln) const;功能强大,convert2d参数中的面的uv参数能起到作用。即返回的结果AcGePoint2d受面的三参数(p, uAxis, vAxis)影响。

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值