
opengl and mirrors???
hi!
i need some help with mirrors in 3d. i'd love to first
render the mirror image into a texture (first to framebuffer,
i guess, and the copy it to texture) and then texture my
mirror object with this image. no stencil buffer tips, thanks.
i can compute the mirrored viewer (please, no trivial
axis aligned mirrors here, i want to place my mirror just
into any place i like), but when i start to render
the view he sees (using glFrustum() & gluLookAt()) i seem
to do something wrong. i just need some help with the
calculations so my rendering loop would give me the right
texture.
if you have good links, please tell me. sourcecode/pseudocode
would be also very nice!
ps. i hope this gets posted only once, i had some trouble with
posting...
[edited by - mirrormack on July 12, 2002 8:44:40 AM]

What do you mean by ''I seem to do something wrong'' ? What happens on the screen ?
i just don''t get the mirrored image. i think i''m
having some trouble setting up the gluLookAt() function
(i''m quite sure my glFrustum() is ok).
any ideas where excatly gluLookAt() should be looking at?
to where the reflected ray goes from the middle of the mirror?
i think there''s something i haven''t figured out in the
computations so it''d be really nice if someone smarter
could here briefly tell the main points about the algorithm
(millions thanks in advance to anyone trying).
having some trouble setting up the gluLookAt() function
(i''m quite sure my glFrustum() is ok).
any ideas where excatly gluLookAt() should be looking at?

to where the reflected ray goes from the middle of the mirror?
i think there''s something i haven''t figured out in the
computations so it''d be really nice if someone smarter
could here briefly tell the main points about the algorithm
(millions thanks in advance to anyone trying).

Using gluLookAt you won''t get a mirror image, you''ll get like a camera image. Things won''t be reflected, they''ll look like someone is viewing from a different place.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
i was thinking i''d gluLookAt() from the mirrored viewer
to the mirrored direction. wouldn''t this give me the mirrored
image?
my head is starting to spin... if you have info on
how do you render the mirror texture please share it with me.
to the mirrored direction. wouldn''t this give me the mirrored
image?
my head is starting to spin... if you have info on
how do you render the mirror texture please share it with me.

it will not look like in a mirror but as when you stand at the (mirrored) position. but left is still left, and right is still right. up still up and down still down...
"take a look around" - limp bizkit
www.google.com
"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia
My Page davepermen.net | My Music on Bandcamp and on Soundcloud
google gave me things that dealed with floor mirrors (the
scaling trick) and some very vague pictures of how to do
this.
but if i stand in the mirrored position and look at the
mirrored direction, wouldn't that be ok? of course if i
look at the original direction it won't work.
any ideas anyone?
[edited by - mirrormack on July 12, 2002 9:30:13 AM]
scaling trick) and some very vague pictures of how to do
this.
but if i stand in the mirrored position and look at the
mirrored direction, wouldn't that be ok? of course if i
look at the original direction it won't work.
any ideas anyone?
[edited by - mirrormack on July 12, 2002 9:30:13 AM]
if i mirror the scene according to the mirror''s plane
i could get the mirror image using stencil buffer,
but that would be the result image on the screen,
image from the viewer''s eyes, not the mirror texture i want.
urgh...
i could get the mirror image using stencil buffer,
but that would be the result image on the screen,
image from the viewer''s eyes, not the mirror texture i want.
urgh...
checked your texture koordinates?
cya,
Phil
Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states
)
cya,
Phil
Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states

Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement