Jump to content
  • Advertisement
Sign in to follow this  
bybw

reflection problem

This topic is 5119 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!