当前位置:网站首页>向量操作与坐标转换相关方法
向量操作与坐标转换相关方法
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));
边栏推荐
- Event related | reveal how Ti-One's support ability for large-scale events is developed
- Accessing user interface settings using systemparametersinfo
- [signal recognition] signal modulation classification based on deep learning CNN with matlab code
- bjdctf_ 2020_ babystack
- The initial user names and passwords of Huawei devices are a large collection that engineers involved in Huawei business should keep in mind and collect!
- [image fusion] multi focus and multi spectral image fusion based on pixel saliency and wavelet transform with matlab code
- The first common node of two linked lists_ The entry of the link in the linked list (Sword finger offer)
- Global and Chinese market of digital fryer 2022-2028: Research Report on technology, participants, trends, market size and share
- jarvisoj_ level2
- [image fusion] image fusion based on NSST and PCNN with matlab code
猜你喜欢
![[WUSTCTF2020]alison_ likes_ jojo](/img/a9/dcc6f524772cd0b8781289cbaef63f.png)
[WUSTCTF2020]alison_ likes_ jojo

RDD basic knowledge points

基因检测,如何帮助患者对抗疾病?
![[OGeek2019]babyrop](/img/74/5f93dcee9ea5a562a7fba5c17aab76.png)
[OGeek2019]babyrop

Accessing user interface settings using systemparametersinfo

PIP install XXX on the terminal but no module named XXX on pycharm

How to turn on win11 notebook power saving mode? How to open win11 computer power saving mode
![[image segmentation] retinal vessel segmentation based on morphology with matlab code](/img/e3/0805df81a597346ea7c2d2da20ac96.png)
[image segmentation] retinal vessel segmentation based on morphology with matlab code

What is the mentality of spot gold worth learning from

bjdctf_ 2020_ babystack
随机推荐
[DDCTF2018](╯°□°)╯︵ ┻━┻
[image fusion] image fusion based on directional discrete cosine transform and principal component analysis with matlab code
Hubei College Upgraded to undergraduate - Hushi family planning department
jarvisoj_ level2
Canal installation configuration
What is automated testing? What software projects are suitable for automated testing?
【TS】函数类型
What should I pay attention to after the live broadcast system source code is set up?
[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer
20 not to be missed ES6 tips
[wustctf2020] climb
[image segmentation] retinal vessel segmentation based on morphology with matlab code
Bjdctf 2020 Bar _ Babystack
Common coding and encryption in penetration testing
[WordPress website] 6 Article content copy prevention
基因检测,如何帮助患者对抗疾病?
前缀和专题训练
What is a CC attack? How to judge whether a website is attacked by CC? How to defend against CC attacks?
Learning to use BACnet gateway of building control system is not so difficult
学会使用楼宇控制系统BACnet网关没那么难