坐标系统

    典型的3D图形应用程序使用两种类型的笛卡尔坐标系:左手坐标系和右手坐标系。在这两种坐标系中,X轴正方向指向右方,Y轴正方向指向上方。你可以通过让你的左手或者右手的指头沿着X轴的正方向并让它们向Y轴正方向弯曲来记住Z轴正方向朝哪,它就是你拇指指向的方向,远离你或者指向你,这个方向就是那个坐标系的Z轴正方向。下面的插图说明了这两个坐标系。

 

     图见相应DX文档
    
    Direct3D 使用左手坐标系,如果你正在移植一个基于右手坐标系的应用程序,那你必须对传给Direct3D的数据做2点变化。
    。翻转三角形定点的顺序以便于系统从头按顺时针方向遍历它们。换句话说,如果顶点是V0,V1,V2,把他们传给Direct3D时就得变成V0,V2,V1。
    。使视口矩阵以Z方向上的-1值去度量世界空间。要做到这一点,请翻转你的视口矩阵所使用的D3DMATRIX结构的标记为_31,_32,_33和_34的成员。
    为了完整显示右手坐标系世界,应使用D3DXMatrixPerspectiveRH和D3DXMatrixOrthoRH函数去定义投影变换,无论如何,应该小心地使用相应的D3DXMatrixLookAtRH函数,反转背面提出顺序,并订制出相应的立方体映射。
    尽管左手和右手坐标系是最常用的坐标系统,但是仍然有其他不同的坐标系被3D软件使用,例如,不同寻常的3D建模应用程序使用Y轴朝着或者远离观察者的坐标系,而且Z轴指向上方。
    严格来讲,一个坐标系的基本向量的方向可以通过被基本向量的详细设置定义过的矩阵的行列式计算被发现。如果行列式是正的,则这个坐标系被称为积极主导(或者右手坐标系),如果行列式是负的,则这个坐标系被称为消极主导(或者左手坐标系)。如果想知道什么是行列式,请看一些线性代数资料。
    一般来说,你可以用左/右手法则从左手坐标系或右手坐标系去判断一个给定的基本向量。
    被定义在3D坐标系中的对象的可执行操作有平移,旋转,缩放。你可以结合这些基本变换去创建一个变换矩阵,想了解详细资料,请看Transforms。
    当你结合一些操作,计算出来的结果不能互换的;你相乘矩阵的顺序至关重要。

 

原文

Coordinate Systems

Typically 3D graphics applications use two types of Cartesian coordinate systems: left-handed and right-handed. In both coordinate systems, the positive x-axis points to the right, and the positive y-axis points up. You can remember which direction the positive z-axis points by pointing the fingers of either your left or right hand in the positive x-direction and curling them into the positive y-direction. The direction your thumb points, either toward or away from you, is the direction that the positive z-axis points for that coordinate system. The following illustration shows these two coordinate systems.

 

    图见相应DX文档

 

Direct3D uses a left-handed coordinate system. If you are porting an application that is based on a right-handed coordinate system, you must make two changes to the data passed to Direct3D.

  • Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them to Direct3D as v0, v2, v1.
  • Use the view matrix to scale world space by -1 in the z-direction. To do this, flip the sign of the _31, _32, _33, and _34 member of the D3DMATRIX structure that you use for your view matrix.

To obtain what amounts to a right-handed world, use the D3DXMatrixPerspectiveRH and D3DXMatrixOrthoRH functions to define the projection transform. However, be careful to use the corresponding D3DXMatrixLookAtRH function, reverse the backface-culling order, and lay out the cube maps accordingly.

Although left-handed and right-handed coordinates are the most common systems, there is a variety of other coordinate systems used in 3D software. For example, it is not unusual for 3D modeling applications to use a coordinate system in which the y-axis points toward or away from the viewer, and the z-axis points up.

Formally, the orientation of a set of basis vectors (i.e. a coordinate system) can be found by the computing the determinant of the matrix defined by the particular set of basis vectors. If the determinant is positive, the basis is said to be "positively" oriented (or right-handed). If the determinant is negative, the basis is said to be "negatively" oriented (or left-handed). For an explanation of what a determinant is, see any linear algebra resource.

Informally, you can use the "right/left hand rule" to determine if a given set of basis vectors form either a right or left handed coordinate system.

The essential operations performed on objects defined in a 3D coordinate system are translation, rotation, and scaling. You can combine these basic transformations to create a transform matrix. For details, see Transforms.

When you combine these operations, the results are not commutative; the order in which you multiply matrices is important.


    
    
   

   

提供了基于BP(Back Propagation)神经网络结合PID(比例-积分-微分)控制策略的Simulink仿真模型。该模型旨在实现对杨艺所著论文《基于S函数的BP神经网络PID控制器及Simulink仿真》中的理论进行实践验证。在Matlab 2016b环境下开发,经过测试,确保能够正常运行,适合学习和研究神经网络在控制系统中的应用。 特点 集成BP神经网络:模型中集成了BP神经网络用于提升PID控制器的性能,使之能更好地适应复杂控制环境。 PID控制优化:利用神经网络的自学习能力,对传统的PID控制算法进行了智能调整,提高控制精度和稳定性。 S函数应用:展示了如何在Simulink中通过S函数嵌入MATLAB代码,实现BP神经网络的定制化逻辑。 兼容性说明:虽然开发于Matlab 2016b,但理论上兼容后续版本,可能会需要调整少量配置以适配不同版本的Matlab。 使用指南 环境要求:确保你的电脑上安装有Matlab 2016b或更高版本。 模型加载: 下载本仓库到本地。 在Matlab中打开.slx文件。 运行仿真: 调整模型参数前,请先熟悉各模块功能和输入输出设置。 运行整个模型,观察控制效果。 参数调整: 用户可以自由调节神经网络的层数、节点数以及PID控制器的参数,探索不同的控制性能。 学习和修改: 通过阅读模型中的注释和查阅相关文献,加深对BP神经网络与PID控制结合的理解。 如需修改S函数内的MATLAB代码,建议有一定的MATLAB编程基础。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值