当前位置:网站首页>关于Unity中的transform.InverseTransformPoint, transform.InverseTransofrmDirection
关于Unity中的transform.InverseTransformPoint, transform.InverseTransofrmDirection
2022-06-24 19:19:00 【charlsdm】
下边是介绍transform.InverseTransformPoint,
transform.InverseTransformDirection和 transform.InverseTransformVector
下边附上代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InversePoint : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log(Vector3.forward);
Debug.Log("转换后的点" + this.transform.InverseTransformPoint(Vector3.forward));
Debug.Log("转换后的方向(不受缩放影响)" + this.transform.InverseTransformDirection(Vector3.forward));
Debug.Log("转换后的方向(受缩放影响)" + this.transform.InverseTransformVector(Vector3.forward));
}
// Update is called once per frame
void Update()
{
}
}
就是将世界坐标转变成相对本地坐标系的点
本地转世界坐标系,受到缩放影响
Debug.Log("本地转世界点" + this.transform.TransformPoint(Vector3.forward));
Debug.Log("本地转世界方向(不受缩放影响)" + this.transform.TransformDirection(Vector3.forward));
Debug.Log("本地 转 世界方向" + this.transform.TransformVector(Vector3.forward));
边栏推荐
- Golang reflection operation collation
- Notes_ Vlan
- Common member methods of the calendar class
- Role of wait function
- 188. 买卖股票的最佳时机 IV
- Shell script
- Simpledateformat thread unsafe
- JUnit unit test
- [cloud native learning notes] learn about kubernetes' pod
- Debugging Analysis of Kernel panics and Kernel oopses using System Map
猜你喜欢

Limit summary (under update)

B站带货当学新东方

188. 买卖股票的最佳时机 IV

memcached完全剖析–1. memcached的基础

Does the developer want to change to software testing?

DHCP operation

Capture the whole process of accessing web pages through Wireshark

I feel that I am bald again when I help my children with their homework. I feel pity for my parents all over the world

How Fiddler works

CondaValueError: The target prefix is the base prefix. Aborting.
随机推荐
Handwritten RPC the next day -- review of some knowledge
Arkit与Character Creator动画曲线的对接
Three more days
Am, FM, PM modulation technology
Packaging_ Conversion between basic type and string type
database/sql
Alibaba cloud lightweight servers open designated ports
JMeter parameterization
Distributed basic concepts
Open function
When to send the update windows message
BBR bandwidth per second conversion logic
Football information query system based on C language course report + project source code + demo ppt+ project screenshot
Summary of message protocol problems
What will you do if you have been ignored by your leaders at work?
Golang reflection operation collation
Simple analysis of WordPress architecture
Limit summary (under update)
[cloud native learning notes] kubernetes Foundation
去掉录屏提醒(七牛云demo)