Sunday, May 22, 2016

unity - get position of GameObject on rendertexture from camera


I'm rendering the camera output to an rendertexture on a plane. This works fine. But I want to put GameObjects on the rendertexture on positions of world objects that are visible on the camera.


camera.WorldToViewportPoint(obj.transform.position) shows the correct positions, but is not mapped to the rendertexture. How can I do this?


So it's GameObject in world > camera input > plane with RenderTexture > world or local position of gameobject on top of rendertexture plane.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...