当前位置:网站首页>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));
}
}
边栏推荐
- Ebpf XDP mount point analysis
- Microsoft Certification (dynamic 365) test
- Pytest testing framework
- Auto. JS to automatically authorize screen capture permission
- BBR bandwidth per second conversion logic
- TCP_ Nodelay and TCP_ CORK
- [cloud native learning notes] kubernetes practice command
- Time standard and format
- DHCP operation
- Pytest test framework II
猜你喜欢

Memcached full profiling – 1 Fundamentals of memcached

Oauth1.0 introduction

(to be optimized and modified) vivado DDR4 SDRAM (MIG) (2.2) IP core learning record

Common data model (updating)

C语言实现DNS请求器

Codeforces Round #720 (Div. 2)

Realization of truth table assignment by discrete mathematical programming

Static routing job

Memcached comprehensive analysis – 2 Understand memcached memory storage

Docking of arkit and character creator animation curves
随机推荐
Foundations of Cryptography
Typescript syntax
Alibaba cloud schedules tasks and automatically releases them
Web project deployment
Blender's landscape
Pod lifecycle in kubernetes
188. the best time to buy and sell stocks IV
RFC 793 why to send reset and when to send reset
SYSCALL_ Define5 setsockopt code flow
Capture the whole process of accessing web pages through Wireshark
Axi DMA IP core operation process
Go coding specification
Time standard and format
Read all text from stdin to a string
Oauth2.0 introduction
(to be optimized and modified) vivado DDR4 SDRAM (MIG) (2.2) IP core learning record
VirtualBox virtual machine installation win10 Enterprise Edition
123. the best time to buy and sell shares III
EditText controls the soft keyboard to search
Logical backup: mysqldump vs physical backup: xtrabackup