我目前正在使用AngularJS和Three.js来尝试开发一个VR应用程序的小例子.我已根据用户代理是否是移动设备来定义控件.这是一个狡猾的方法,但它只是一个例子.OrbitControls用于非移动设备,否则使用DeviceOrientationControls.
var controls = new THREE.OrbitControls(camera, game.renderer.domElement);
controls.noPan = true;
controls.noZoom = true;
controls.target.set(
camera.position.x,
camera.position.y,
camera.position.z
);
// Really dodgy method of checking if we're on mobile or not
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
controls = new THREE.DeviceOrientationControls(camera, true);
controls.connect();
controls.update();
}
return controls;
Run Code Online (Sandbox Code Playgroud)
我还创建了一些实际显示的对象.
this.camera = new THREE.PerspectiveCamera(90, window.innerWidth / window.innerHeight, 0.001, 1000);
this.camera.position.set(0, 15, 0);
this.textGeometry = new THREE.TextGeometry("Hello World", { size: 5, height: 1 });
this.textMesh = new THREE.Mesh(this.textGeometry, new THREE.MeshBasicMaterial({
color: 0xFF0000, opacity: 1
}));
this.textMesh.position.set(-20, 0, …Run Code Online (Sandbox Code Playgroud) 在过去的几个月里,我一直在Unity的一个小项目上工作,使用Git进行源代码控制.我最近买了一台新笔记本电脑,正在演示我在不同地点的进度.
我在应用程序中安装了Unity和所有相关的运行时,并将源下载到新机器.该项目在Unity中打开,但"层次结构"视图显示了我的预制件所在的位置.
所有资源(预制件,模型,脚本)都与原始开发机器上的目录位于同一目录中,但在将它们下载到新机器的过程中,它们会以某种方式"脱离链接".
我试过搜索,但一直无法找到解决这个特殊问题的方法,只是重新创建一切.
谢谢您的帮助.