x


Flip/Mirror > Camera?

Is there a way to flip the Camera (let's say in X position), so the whole scene is "mirrored" for example to the right side,?

more ▼

asked Jun 23, 2010 at 07:07 AM

SOIL gravatar image

SOIL
89 64 48 56

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

You can use something like this (Once in start should do it):

Matrix4x4 mat = Camera.main.projectionMatrix;
mat *= Matrix4x4.Scale(new Vector3(-1, 1, 1));
Camera.main.projectionMatrix = mat;
more ▼

answered Jun 23, 2010 at 11:34 AM

Mike 3 gravatar image

Mike 3
32.8k 18 80 290

i haven't tried it yet, need to give that to my programmer, and he is at work atm (got no time). i help him as good as i can and i am only a grafic artist with a bit knowledge about how things work.

  • so we are not talking about a render to texture method?
  • it really flips the whole view in x position?
  • Does it work on iphone too?
Jun 23, 2010 at 12:08 PM SOIL

Should do. Flips the camera horizontally on 2.6, and the same function is there for iphone. It's old style flipping, nothing fancy,should work on any computer

Jun 23, 2010 at 12:38 PM Mike 3

you are my god :D thnx!! is exactly that code the one which works on iphone too? xD

Jun 23, 2010 at 01:43 PM SOIL

Yup yup, should be identical

Jun 23, 2010 at 02:09 PM Mike 3

Hello Mike, we tried the script now. It seems to work, but it flips the normal matrix of all objects. in play mode the camera is facing to the right direction. in game mode i recognize my objects areflipped. but it's like all normals where flipped too. Do you know how to fix that problem?

Aug 09, 2010 at 03:16 PM SOIL
(comments are locked)
10|3000 characters needed characters left

If you have render to texture (pro only) you could easily achieve this by rendering a texture and then flip that texture before it's displayed.

more ▼

answered Jun 23, 2010 at 11:04 AM

StephanK gravatar image

StephanK
6.5k 116 103 149

That's a solution for Animated Textures or so. What i need is a flip for right handed iphone users. the whole game-view shell be flipped, and the touch-matrix would be moved to the right position too. thing is my game works with on thumb. and the touchfield for it is atm on the left side. if i want to move the touchfield to the right side, i also have to flip the camera in x position, cause the game is strictly layouted on that way.

Jun 23, 2010 at 12:04 PM SOIL
(comments are locked)
10|3000 characters needed characters left
more ▼

answered Mar 11, 2011 at 04:10 AM

devigod gravatar image

devigod
98 9 6 14

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4721
x104

asked: Jun 23, 2010 at 07:07 AM

Seen: 7170 times

Last Updated: Jun 23, 2010 at 07:07 AM