Interactive 3D rendering


I implemented a ray tracer with VC++. I am not using OpenGL in it because I don’t see OpenGL’s advantages in ray tracing. Now I need to add interactive ability to it. That is, when user drag and drop the mouse over the image, the ray tracer changes the viewing position and direction and traces again according to the new viewing location.

One of the problem I need to solve is how to translate user’s mouse movement into viewing position’s change. Can anyone help me in this?

Thank you a lot!

I think I know what you want to do and I will give
you my thought on that, but I would like ot make a
comment first.

A “ray-tracer” will probably never be fast enough to
be used for “interactive” graphics… Simply, the
recursive calls that must be made for reflections,
translucencies, etc, make the ray-tracer a very
expensive tool in terms of computation, even when
advanced techniques are used for sorting through
the objects that are hit and intersected… If you
want interactive graphics, use OpenGL instead.

There are three things you need to do to get any
mouse feedback: 1) trap mouse motions over/in a
window, 2) translate these calls into rotations
of your world/camera, and 3) move the world or

My recommendation to you is to always rotate the
world about its center when a mouse motion is
trapped for this purpose. There are lots of details
you will need to work out…

Originally posted by iznogoud:

A “ray-tracer” will probably never be fast enough to
be used for “interactive” graphics…

Interactive raytracers do exist and are primary used for large scale scientific visualization. They run on super computers and large clusters but do provide interactive framerates. It’s pretty cool stuff…

At Utah:

At Saarland: