Skip to Content
下一代空间计算:AR与VR创新理论与实践
book

下一代空间计算:AR与VR创新理论与实践

by Erin Pangilinan, Steve Lukas, Vasanth Mohan
October 2020
Intermediate to advanced
302 pages
5h 22m
Chinese
Publishing House of Electronics Industry
Content preview from 下一代空间计算:AR与VR创新理论与实践
146
|
第
8
章
三项
VR/AR
最佳开发实践
首先,让我们进行一些参数设置。我们需要使用变量来控制远程传送及渲染传送路径的
方法。幸运的是,
Unity
中有一个内置的线形渲染器组件,支持自定义外观。
完成这些设置后,我们就可以专注于实现远程传送功能了。根据硬件平台的控制器个数
差异,这部分代码同样会有差异。我们的目标是当玩家按下某个按钮(比如,
Vive
控制
器上的触控板或
Oculus Rift
上的扳机按钮)时,显示远程传送的曲线路径,当用户松开
该按钮后传送到目标位置。
除此之外,你还可以对玩家的视角进行淡入
/
淡出处理,以提升远程传送的视觉体验(请
参考
GitHub
仓库中的实现代码):
public Vector3 gravity; //set in inspector as (0, -9.8, 0)
public LineRenderer path; //the component that will render our path
private Vector3 teleportLocation; //save the location of where we want to teleport
private Player player; //the player we will be teleporting
void Update() { //called every fame
if (!CheckTeleport(LeftHand)) { //check the left hand
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
GPT-3

GPT-3

Sandra Kublik, Shubham Saboo
解密金融数据

解密金融数据

Justin Pauley
机器学习流水线实战

机器学习流水线实战

Hannes Hapke, Catherine Nelson

Publisher Resources

ISBN: 9787121386725