Hi all,
I tried to send rays along the solar direction vector to track the location of solar reflections, but I wondered how the origin of rays can be specified when using vwrays to emit rays from the source (if this step is right)?
Also, as I know, when the emitted rays are piped to rtrace to do ray-tracing, the option such as -ot can be set to expose ray tree. Since I just wanted to see the targets on where the reflected rays terminate, how to set such option correctly?
Thanks,
Clarence
Rays from the sun would correspond to a parallel view (-vtl) rather than a perspective view. If you use the -ot option to rtrace, it will print the entire ray tree (minus rays to light sources), but you can limit reflections by setting -lr 1 in your case. Then, just look for output that begins with a tab (’\t’).
Hi Greg,
Thanks for your answers which provide me some hints for rendering rays from the sun. I actually wanted to achieve what I expected using froward ray-tracing method with the following basic command (but didn’t make it):
#vwrays -vf view.vf -x 400 -y 400 -ff | rtrace -ab 1 -dr1 -ad 10000 -lw 0.0001 -lr 1 -ot -ffc vwrays -vf view.vf -x 400 -y 400 -d
forward/scene.oct > a.hdr
##The scene consisted of the sun, a diffuse ground and a specular wall.
Should the view.vf contain the viewpoint set from the source? In addition, for setting options of rtrace, did I miss something critical here?
Thanks,
Clarence
Hi Clarence. You can’t generate an image of reflected rays from rtrace, since the -ffc option only works with the default “-ov” output. Also, the rtrace “-ot” option doesn’t work by itself. You need something like “-otv” at minimum. Again, you couldn’t create an image from that, as you would have multiple output values per pixel.
Stepping back, I’m still not sure what you are trying to get out of this calculation. Do you want to paint surfaces in your scene where sun rays or reflected? Or do you want to track the rays themselves, i.e., get origins and directions and the like? The latter is much easier to do than the former, but you would probably want some way to visualize the rays afterwards, which is tricky.
Hi Greg,
Sorry for making you confused. It seems like the latter one was what I wanted to achieve. Unfortunately, I originally thought in a wrong way (like generating an image of reflected rays by that command) to figure it out.
Anyway, is it correct to assume a large distance (like 100000m or more) between the sun and a point of interest in my scene to determine the origin of the sun, since I already know the direction vector of the sun ray.
Thanks,
Clarence
I would not put the view point at the sun position – it is not necessary and would likely cause other problems. Just use a parallel view type (-vtv) and horizontal and vertical sizes large enough to encompass the region of interest. The view direction will be the (reverse) vector to the solar position.
So the view that you recommended should be like rvu -vtl -vd (points to the solar position) -vh 2000 -vv 2000 ?
Not exactly. Use a -vd that points away from the solar position (the negative “source” vector). Your -vh and -vv should be large enough to encompass your scene in world coordinates, but not larger. The -vp option should be set to the center of your view added to (the -vd unit vector times the distance from the view center to the edge of your scene).
Greg, I was trying to the later (i.e., send out a ray and want to get its reflection on a surface).
For example, I used “vwrays -ff -vtl -vp 2 -5 1.5 -vd 0 1 0 -vh 0.5 -vv 0.5 -x 1 -y 1|rtrace -ffa -opdm -lr 1 test.oct > result.txt” to generate a ray to hit on a vertical surface. In “-opdm”, ‘p’ can give me the position where the ray hits on the surface, which will become the origin of the reflected ray. However, ‘d’ gives me the same direction as the ray I sent, which does not seem right. Did I miss anything?
Thanks,
Tommy
Hi Tommy,
The ‘d’ in “-opdm” is the current ray direction, not the direction of a daughter ray. There are often more than one daughter rays, so it would not be possible to choose one uniquely. If you use “-oTpdm”, then you will see the parameters associated with every ray traced. If you use “-otpdm”, then it will leave off the many source rays.