Sign in to follow this  

reflection problem

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,everyone. I have a problem with the reflected image. In my RTT pass, I get the reflection view by multiplying the current modelview matrix by a reflection matrix, and load it as the current modelview matrix then setup the camera. Then someting weird happened. When I moved my camera, the mirror image moved too. But it should be in the middle of the plane!!! I think I must make some mistakes when I got the reflection view. I've read Yann's article about reflection, he said Mreflview = Mc * Mf (* Mo) Mc = current modelview matrix Mf = reflection matrix Mo = object matrix I tried to multiply the objectMatrix as the following: | 1 0 0 x | | 0 1 0 y | | 0 0 1 z | | 0 0 0 1 | then the mirror image disappeared. Any help would be appreciated...

Share this post


Link to post
Share on other sites
Ok first of all say you want to reflect it over the xz plane then the matrix you would multiply is:

| 1 0 0 0 |
| 0 1 0 0 |
| 0 0-1 0 |
| 0 0 0 1 |

If you don't have the minus it won't be reflected. As for your "reflection moving" can you post a screenshot of it, hard to tell what you mean.

Share this post


Link to post
Share on other sites
Quote:
Original post by skow
Ok first of all say you want to reflect it over the xz plane then the matrix you would multiply is:

| 1 0 0 0 |
| 0 1 0 0 |
| 0 0-1 0 |
| 0 0 0 1 |

If you don't have the minus it won't be reflected. As for your "reflection moving" can you post a screenshot of it, hard to tell what you mean.


| 1 0 0 0x|
| 0-1 0 0y|
| 0 0 1 0z|
| 0 0 0 1 |

That would be.

Share this post


Link to post
Share on other sites

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this