x


Mirrors of a car?

Hello, we all know the backward mirrors of a car :P

my question is, since i don't have unity pro and i am an absolute retard when it comes to understanding cubemaps, is it possible to hook a camera onto the mirror and projecting the camera's field of view as a backward mirror?

if yes, how is this done?

at the moment i'm trying it like this :

var Mirror : Camera;

var reflection : Cubemap;

reflection = Mirror.RenderToCubemap(reflection);

he'es expecting a boolean though and i don't get why.

Well, i've reviewed the code and now got this :

function Update () 
{




spiegelrechts.RenderToCubemap(spiegelmap);

rueckspiegel.Texture.Cubemap = spiegelmap;


//But i don't seem to get how to assign the cubemap to my mirror now.


}
more ▼

asked Jul 29 '11 at 07:36 AM

biohazard gravatar image

biohazard
288 36 42 46

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

1 answer: sort voted first

If you want mirrors in realtime without Pro, you can use multiple cameras. You'll need some kind of fancy maths to get the perfect matrix, or you can just tweak it until it looks good.

For non-realtime, do what you are doing above, but follow the documentation rather than your intuition ... or ask yourself why you would both pass a parameter and use the return value... with to same variable.

more ▼

answered Jul 29 '11 at 08:29 AM

Waz gravatar image

Waz
6.5k 23 33 71

i don't get what you mean with the non-realtime, that is what i want to do but please stop speaking in riddles :S just tell me what i'm doing wrong please :)

Jul 29 '11 at 08:32 AM biohazard

You answered it yourself - don't use the return value. But yes, sorry, even the non-realtime RenderToCubemap is pro-only. The realtime option still applies.

Jul 29 '11 at 08:40 AM Waz

No need to be sorry, but it'd be highly appreciated if you had a small example on how to do the realtime mirror effect with multiple cameras

Jul 29 '11 at 08:41 AM biohazard

I'm not riddling you, I'm criticising you for not reading the documentation before using a function.

Jul 29 '11 at 08:42 AM Waz

i will read the doc next time, now gimme a cookie! just kidding, how would i do the realtime mirror effects using cameras?

is this done by using Matrix4x4?

Jul 29 '11 at 08:44 AM biohazard
(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:

x3124
x114
x59
x54

asked: Jul 29 '11 at 07:36 AM

Seen: 1149 times

Last Updated: Jul 29 '11 at 12:02 PM