当前位置:网站首页>向量操作与坐标转换相关方法
向量操作与坐标转换相关方法
2022-06-24 06:44:00 【Kenight_】
获得 position 的本地坐标, position 是一个世界坐标点
最后获得 position 在本地坐标中的相对坐标
举例:如 transform.positon = (1,0,0)
则下面是获取世界坐标 (2,0,0) 相对于本地位置 (1,0,0) 的坐标即 (1,0,0)
Debug.Log(transform.InverseTransformPoint(2, 0, 0));
Transform.TransformPoint
获得 position 的世界坐标
position 是基于当前物体本地坐标上的相对坐标(位移)
举例:如 transform.positon = (1,0,0) 则下面的结果应该为 (3,0,0)
Debug.Log(transform.TransformPoint(2, 0, 0));
Transform.InverseTransformDirection
获取 direction 在本地坐标中的方向向量,direction 本来是世界坐标系中的方向向量
只会受物体的 rotation 所影响
如果物体在 x 轴旋转 90 度后,则世界坐标的 up (0,1,0) 为本地的 -forward (0,0,-1)
Debug.Log(transform.InverseTransformDirection(Vector3.up));
Transform.TransformDirection
获取 direction 的世界坐标
如果物体在 x 轴旋转 90 度后,则它的 up 为世界坐标中的 forward
Debug.Log(transform.TransformDirection(Vector3.up));
边栏推荐
- 20个不容错过的ES6技巧
- How VPN works
- 基因检测,如何帮助患者对抗疾病?
- Global and Chinese markets for food puffers 2022-2028: Research Report on technology, participants, trends, market size and share
- 阿里云全链路数据治理
- [cnpm] tutorial
- A summary of the posture of bouncing and forwarding around the firewall
- bjdctf_ 2020_ babystack
- 使用SystemParametersInfo访问用户界面设置
- Tidb operator source code reading (IV) control cycle of components
猜你喜欢
╯︵ ┻━┻](/img/26/6986a8ae6c00eb2431a082dc0ff978.png)
[DDCTF2018](╯°□°)╯︵ ┻━┻
![选择器(>,~,+,[])](/img/7e/2becfcf7a7b2e743772deee5916caf.png)
选择器(>,~,+,[])

Prefix and topic training

bjdctf_2020_babystack
![[tips] use the deep learning toolbox of MATLAB deepnetworkdesigner to quickly design](/img/74/f615191715a9ac58a8546f8d1e8f8d.png)
[tips] use the deep learning toolbox of MATLAB deepnetworkdesigner to quickly design

二分专题训练
![(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]](/img/33/d601a6f92b1b73798dceb027263223.png)
(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]

Camera calibration (calibration purpose and principle)

MaxCompute远程连接,上传、下载数据文件操作
![[mrctf2020] thousand layer routine](/img/8e/d7b6e7025b87ea0f43a6123760a113.png)
[mrctf2020] thousand layer routine
随机推荐
The latest crawler tutorial in 2021: video demonstration of web crawling
Learning to use BACnet gateway of building control system is not so difficult
20个不容错过的ES6技巧
什么是CC攻击?如何判断网站是否被CC攻击? CC攻击怎么防御?
[understanding of opportunity -29]: Guiguzi - internal dialogue - five levels of communication with superiors
MySQL enable binlog
[Lua language from bronze to king] Part 2: development environment construction +3 editor usage examples
[learn FPGA programming from scratch -42]: Vision - technological evolution of chip design in the "post Moorish era" - 1 - current situation
[MySQL usage Script] clone data tables, save query data to data tables, and create temporary tables
【TS】函数类型
Deploy L2TP in VPN (Part 2)
Super fast reading in OI
10 common malware detection and analysis platforms
[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence
How VPN works
Shell script for MySQL real-time synchronization of binlog
[OGeek2019]babyrop
Software performance test analysis and tuning practice path - JMeter's performance pressure test analysis and tuning of RPC Services - manuscript excerpts
[tips] use the deep learning toolbox of MATLAB deepnetworkdesigner to quickly design
MFC multithreaded semaphore csemaphore critical area and mutually exclusive events