当前位置:网站首页>Methods of vector operation and coordinate transformation
Methods of vector operation and coordinate transformation
2022-06-24 08:04:00 【Kenight_】
get position Local coordinates of , position Is a world coordinate point
At last get position Relative coordinates in local coordinates
give an example : Such as transform.positon = (1,0,0)
Then the following is to obtain the world coordinates (2,0,0) Relative to local location (1,0,0) The coordinates of are (1,0,0)
Debug.Log(transform.InverseTransformPoint(2, 0, 0));
Transform.TransformPoint
get position The world coordinates of
position It is based on the relative coordinates of the local coordinates of the current object ( Displacement )
give an example : Such as transform.positon = (1,0,0) Then the following result should be (3,0,0)
Debug.Log(transform.TransformPoint(2, 0, 0));
Transform.InverseTransformDirection
obtain direction Direction vector in local coordinates ,direction It was originally a direction vector in the world coordinate system
Will only be affected by objects rotation Affected by
If the object is x Shaft rotation 90 Deg. , Then the up (0,1,0) For the local -forward (0,0,-1)
Debug.Log(transform.InverseTransformDirection(Vector3.up));
Transform.TransformDirection
obtain direction The world coordinates of
If the object is x Shaft rotation 90 Deg. , Then it's up Is... In the world coordinates forward
Debug.Log(transform.TransformDirection(Vector3.up));
边栏推荐
猜你喜欢

JDBC 在性能测试中的应用

On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar

Cloud development who is the source code of undercover applet

Latest news of awtk: new usage of grid control

Part 1: building OpenGL environment

不止于观测|阿里云可观测套件正式发布

Case examples of corpus data processing (cases related to sentence retrieval)

Vulnhub target: boredhackerblog: social network

1-4metasploitable2介绍

From jsonpath and XPath to spl
随机推荐
第 2 篇:绘制一个窗口
BOM笔记
3-list introduction
[nilm] non intrusive load decomposition module nilmtk installation tutorial
Chapter 3: drawing triangles
Cloud development who is the source code of undercover applet
L1-019 who goes first (15 points)
Baidu map, coordinate inversion, picking coordinate position
Inline element, block element, inline block element
Backup and restore SQL Server Databases locally
面试中的最常被问到的两种锁
使用 kubeconfig 文件组织集群访问
Free ICP domain name filing interface
How does dating software cut your leeks
Using kubeconfig files to organize cluster access
BOM notes
从 jsonpath 和 xpath 到 SPL
Domain environment importing Tencent cloud considerations
JS implementation to check whether an array object contains values from another array object
解决笔记本键盘禁用失败问题