当前位置:网站首页>Unity about conversion between local and world coordinates
Unity about conversion between local and world coordinates
2022-06-24 21:34:00 【charlsdm】
The common one is transformPoint This kind of API Refer to the
The code I wrote is attached below
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateCube : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
[ContextMenu(" Create empty object in front left ")]
void TestFun1()
{
// Vector3 pos = this.transform.TransformPoint(new Vector3(-1, 0, 1));
GameObject obj = new GameObject("hello");
obj.transform.position = this.transform.TransformPoint(new Vector3(-1, 0, 1));
}
[ContextMenu(" Reluctantly create 3 A sphere ")]
void TestFun2()
{
GameObject objOne = GameObject.CreatePrimitive(PrimitiveType.Sphere);
objOne.transform.position = this.transform.TransformPoint(new Vector3(0, 0, 1));
GameObject objTwo = GameObject.CreatePrimitive(PrimitiveType.Sphere);
objTwo.transform.position = this.transform.TransformPoint(new Vector3(0, 0, 2));
GameObject objThree = GameObject.CreatePrimitive(PrimitiveType.Sphere);
objThree.transform.position = this.transform.TransformPoint(new Vector3(0, 0, 3));
}
}
边栏推荐
- Arkit与Character Creator动画曲线的对接
- 大厂出海,败于“姿态”
- 去掉录屏提醒(七牛云demo)
- Pod lifecycle in kubernetes
- JMeter basic learning records
- Go coding specification
- Web automation: web control interaction / multi window processing / Web page frame
- 升哲科技 AI 智能防溺水服务上线
- EditText 控制软键盘出现 搜索
- Adding subscribers to a list using mailchimp's API V3
猜你喜欢

Station B takes goods to learn from New Oriental

Memcached comprehensive analysis – 3 Deletion mechanism and development direction of memcached

Simple analysis of WordPress architecture

Handwritten RPC the next day -- review of some knowledge

Appium desktop introduction

66 pitfalls in go programming language: pitfalls and common errors of golang developers

Learn to use a new technology quickly

Analysis of BBR congestion control state machine

memcached全面剖析–2. 理解memcached的內存存儲

123. 买卖股票的最佳时机 III
随机推荐
Pod lifecycle in kubernetes
关于Unity中的transform.InverseTransformPoint, transform.InverseTransofrmDirection
去掉录屏提醒(七牛云demo)
Analysis of BBR congestion control state machine
Memcached comprehensive analysis – 5 Memcached applications and compatible programs
Pyaudio audio recording
The virtual currency evaporated $2trillion in seven months, and the "musks" ended the dream of 150000 people becoming rich
Multi view function in blender
Pattern recognition - 1 Bayesian decision theory_ P1
Interpretation of ebpf sockops code
Remember the frequently forgotten problem of continuously reading pictures -%04d
Concepts of kubernetes components
[cloud native learning notes] learn about kubernetes' pod
data link layer
66 pitfalls in go programming language: pitfalls and common errors of golang developers
Geek University cloud native training camp
EditText controls the soft keyboard to search
Oauth2.0 introduction
What does CTO (technical director) usually do?
大厂出海,败于“姿态”