如何在Unity3D中通过触摸来操纵3d对象的各个部分 [英] How to manipulate parts of a 3d object by touch in Unity3D

查看:119
本文介绍了如何在Unity3D中通过触摸来操纵3d对象的各个部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在开发一个android项目.我正在unity3d游戏引擎中工作.我想选择a.obj 3D对象的一部分并通过触摸对其进行操作. 是否可以获取触摸位置的x,y和z坐标?

Hey guys,
I am developing an android project.I am working in unity3d game engine.I want to select parts of a.obj 3D object and manipulate it by touching.How can I do that??
Is it possible to get the x,y and z coordinates of position of touch??

推荐答案

搜索称为"3D Picking"或"Mouse"的概念采摘''或射线铸造或全部三种.

有一个Unity3D摄像头功能"ScreenPointToRay" [射线广播 [
Search for a concept called ''3D Picking'' or ''Mouse picking'' Or Ray-casting or all three.

There is a Unity3D Camera function ''ScreenPointToRay''[^]
which gives you a 3D ray starting from your 2D screen along the 3D viewing direction.

Also check out the Raycast[^] function which gives you the 3D object hit by a ray (if any) in the scene.

I hope this helps


这篇关于如何在Unity3D中通过触摸来操纵3d对象的各个部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆