fast reflections

Started by
4 comments, last by Alrecenk 18 years, 9 months ago
I want to create an ebook cover generator, but I'm not sure exactly how to do fast reflections. Although I programmed reflections into my ray tracer at http://www.coolgroups.com/raytracer/, they're just too slow. Does anyone have any ideas on accelerating the code for an ebook cover creator that supports reflections? Mike http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Advertisement
what the heck is an e book cover creator?
See http://www.ecoverstudio.com/.

Mike
http://www.coolgroups.com/forum
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
I'm not sure exactly what you want, but how about this:
You run along the bottom edge of your shape that you want to reflect, pixel-by-pixel from left to right. You copy the pixel from the bottom of the shape, write it to the pixel underneath it then move the "read" pointer up one pixel and the "write" pointer down one pixel, copy again. Carry on for however many pixels you need, fading out the value of the written pixel as you go (so at the top you write a very strong value, at the bottom edge you have a faint one showing through the background colour more. Once you have faded out to nothing, move to the next pixel right and repeat.
I hope this is sort of clear...

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

That would create a 2d reflection, but I'd like a mathematically correct 3d reflection. In some cases they may be similar, but not always.

Mike
http://www.coolgroups.com/forum
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
To reflect a point in 3D you can create a vector from your point to the nearest position on the plane you are reflecting over. Then the reflected point is the old point plus two times that vector.

If you were trying to create a reflection in real time the basic method would be to create the reflection as a 3D object and place it where it would be behind the surface that is reflecting. Then draw the reflection only inside the other object.


btw:the easiest way to find the closest point on the plane is to create a line perpendicular to the plane and see where it collides with the plane

This topic is closed to new replies.

Advertisement