[SOLVED] Mirror rendered camera image

Hi there,

I’m working on an app, that enables a user to configure the measurements of an arm model. This should be possible for a right and a left arm. To save some time, I’m looking for a way to just mirror the rendered camera image when either a right or left arm is selected. Is this possible, for example by scaling some transformation matrix?

Yes, I could mirror my model or vertices. But this would take considerably more time, because I manipulate the mesh itself and would have to fix normals and other oddities in scripts.

Thank you in advance!

Hi @chr33z,

You can take a look at this planar reflections example, it shows how to calculate the mirrored camera matrix and render reflections on a render texture.

https://developer.playcanvas.com/en/tutorials/planar-mirror-reflection/

1 Like

You could try using a negative X scale to ‘flip’ the image element. There may be some issues with this depending on the use case though.

2 Likes

Hey!

I also thought about this, but I don’t know which parameter or component of the camera entity I could flip the axis on. What do you mean by the “image” element?

Thanks!

I assumed that you were talking about a render texture here?

No, I’m talking about the image that a single camera in the scene would render. My hope is that there is some “hack” that would allow me to flip the rendered image along an axis. But I guess I could also work with render textures here and flip the image of a render texture.

@Leonidas approach would most certainly work, but I would prefer to keep the implementation complexity low.

Ohhh, unfortunately thats tricker :thinking: Can’t think of a ‘simple’ solution besides rendering to an image or using a post processing effect.

1 Like

Thank you for your input! I achieved the effect with a simple post processing effect that flips the uvs of the rendered image.

2 Likes