1

I am using Unity 3D and want to render an image on a texture, which should be stuck at one point, not stuck with the camera. How can I do that?

I am new to Unity.

4

1 回答 1

0

您可以做的是创建一个平面或某种图形来保存该纹理。然后,您将向该平面添加网格渲染器并将纹理分配给该平面的渲染器。这样,平面将“保持”纹理并将其保持在特定点。

例如:

Texture2d texture = new Texture2d();
texture.mainTexture = ...
GameObject.Find("THE PLAIN'S NAME").renderer.material.mainTexture = texture;

编辑:对于网络摄像头纹理:

WebCamTexture texture = new WebcamTexture();
GameObject.Find("THE PLAIN'S NAME").renderer.material.mainTexture = texture;
texture.Play();
于 2013-01-08T17:14:43.920 回答