当前位置:网站首页>Unity rotation test
Unity rotation test
2022-07-24 12:22:00 【Phyllostachys pubescens】
public class UnityApITest_1 : MonoBehaviour {
// Quaternions are multiplied by vectors
public GameObject go;
public GameObject resGo;
public Vector3 euler;
private void Update()
{
Debug.DrawLine(Vector3.zero, go.transform.position);
Debug.DrawLine(Vector3.zero, resGo.transform.position);
// Set the rotation
if (Input.GetKeyDown(KeyCode.A))
{
// Get the value of Quaternion
Quaternion qua = Quaternion.Euler(euler);
// Four yuan number * Get the new position of the vector
Vector3 res = qua * go.transform.position;
Debug.Log(" The result of quaternion multiplying vector is " + res);
resGo.transform.position = res;
// The change of one's own angle
resGo.transform.rotation = qua * go.transform.rotation;
}
// Look at the target object
if (Input.GetKeyDown(KeyCode.B))
{
// Suppose the target object is the origin
Vector3 dir = Vector3.zero - go.transform.position;
go.transform.forward = dir.normalized;
}
}
}
边栏推荐
- Detailed OSPF configuration of layer 3 switch / router [Huawei ENSP experiment]
- TypeNameExtractor could not be found
- Convergence rules for 4 * 4 image weights
- MySQL common functions
- Delphi gexperts expert instructions for improving development efficiency
- [data mining engineer - written examination] sheen company in 2022
- Try... Finally summary
- [Commons beanautils topic] 005- convertutils topic
- QT notes - qtxml
- Anaconda environment migration
猜你喜欢
![[data mining engineer - written examination] sheen company in 2022](/img/67/c61dfce8c397ab55fab835b6e81a5f.jpg)
[data mining engineer - written examination] sheen company in 2022

微信公众号开发:素材管理(临时、永久)

With the strong development of cloud native, how should enterprises seize business opportunities

Examples of map search

QT notes - realize form adaptation
![[function test] test of the project - login and post function](/img/64/c9bbf34964622f4f013b1184eeb1e0.jpg)
[function test] test of the project - login and post function

QT notes - EventFilter event filter

Qt5.12 + vs2019 cannot locate the program input point in the dynamic link library

字符串匹配的KMP

Do you regret learning it?
随机推荐
GCC的基本用法
Buckle practice - 27 score after turning the matrix
One of his birds sold for 60million -- the collection of eight mountain people in the Ming and Qing Dynasties
Overview of MES system equipment management (medium)
Oceanbase Database Setup Test
Pushgateway installation and Prometheus configuration
QT notes - qtxml
Use of multithreading in QT
In kuborad graphical interface, operate kubernetes cluster to realize master-slave replication in MySQL
[leetcode]- linked list-3
如何在IM系统中实现抢红包功能?
thinkphp 实现数据库备份
Leetcode:51. queen n
gcc -l参数和-L参数的区别
STM32——C语言基础
动态内存管理
Force deduction exercise - 26 split array into continuous subsequences
for mysql
makefile快速使用
3、 Implementation principle of MFC message mapping mechanism