- Start Unity with the opengl+stereo shortcut. If you don't have it setup already, create a shortcut to the recommended Unity Pro 4.5.5 sp3 and add parameters -force-opengl -enable-stereoscopic3d
在开启OpenGL立体的模式下,打开Unity快捷方式;如果没有这项设置,则创建一个推荐使用的Unity Pro 4.5.5 sp3的快捷方式,添加“-force-opengl -enable-stereoscopic3d”参数。
- Create empty Unity project
创建一个Unity工程。
- Import the ZSCore unity package from the website, into your project
将从网站下载的ZSCoreUnity资源包导入创建的工程。
- Drop the ZSCore prefab into your scene’s Hierarchy and assign ZSCore CurrentCamera to the ‘Main Camera’
拖拽ZSCore预设物体到场景中的Hierarchy面板上,指定 ZSCore中的
CurrentCamera为“主相机”(MainCamera)。
- Create a viewing subject, example drop in a GameObject/Cube, centered at origin
创建一个可视物体,例如随便在GameObject中创建一个立方体(GameObject/Cube)。
- Position the main camera from the cube. Set the distance to make the cube appear as if it is sitting on the screen, at Zero Parallax. By default this distance needs to be 0.41025. Since the subject is at the origin, the camera can be place at say (0,0,-0.41) for example.
在Cube的位置上放置摄像机,设置足够的距离,在0视差位置上,使Cube就像坐在屏幕上一样。
- However the large cube needs to be sized down since the camera is currently inside the cube. So scale the cube down, 0.06 say. Note that the zSpace display represents these units as real world meters, so .06 will present a 6cm cube.
然而较大的立方体需要被适当的缩小,因为当前的相机是在Cube里面;所以将Cube缩放到0.06。注意ZSpace显示系统表示的单位是现实世界中的米,因此0.06表示一个6cm的Cube。
- Next add lighting and texture, otherwise it is difficult to perceive the scene correctly, and the stereoscopic effects will be hard to see. For example add, GameObject/PointLight at say (1,2,-.1)
下一步添加灯光与贴图,否则很难准确的感受到当前的场景,立体效果也很难看到。例如在(1,2,-.1)位置上添加点光源-GameObject/PointLight。
- Also you might see the object disappears when you head dips forward. This is because the default Main Camera/NearClipping/Plane value is too large, so reduce it to 0.03. Note that if it is too small, say .01, then you will also get clipping when you angle your head.
有时候俯首向前看,会发现物体消失了,这是因为默认主相机的Camera/NearClipping/Plane value太大,所以降到0.03就可以了。注意如果值太小如0.01,当旋转头部的角度时候会出现剪切面。
- Play
运行。
If you are constrained by the scale ofyour model, say your cube must be of size
6.0. You need to move the camera out,but you also need to adjust the impact of head tracking. Let’s keep the cube atzero parallax. Let’s also create the same visual effect we saw originally,where the cube appears to be 6cm big.
如果被迫放大模型,假设模型的大小设置为6;这是需要将摄像机向外移动,但是也需要调整头部追踪的影响,保持Cube在0视差的位置上。我们需要创造一种原先的视觉效果,就是Cube是6cm的时候看到的那样。
- Set ZSCore/ViewerScale = 100
- Set the Main Camera at (0,0,-41.0)
- Play()