POV-Ray : Newsgroups : povray.general : Trace Function internals : Trace Function internals Server Time
31 Jul 2024 12:27:06 EDT (-0400)
  Trace Function internals  
From: FrogRay
Date: 12 Feb 2007 04:05:00
Message: <web.45d02adf708d9a33f5db7280@news.povray.org>
Here's a question about the trace function.
When tracing from a starting point A to an object B, does the distance
between A and B have any effect on rendering time.
My guess would be no, because:
Given the equations of any two non-parallel lines (in 2D), finding the point
where the two lines intersect is achieved by solving a simple simultaneous
equation.  One does not (and could not) compare every possible value of y1
and y2, given x, to find the point of intersection. I say "could not" in
the sense that any line-segment can be divided up into an infintesimal
number of points and the point of intersection may not be a rational
number.
I don't think that PovRay would look at every possible point between the
starting point and the target object. However, imagine using trace where
the target object was a complex CSG object, mesh, isosurface, etc.  The
maths involved here would be more than a mere simultaneous equation and
admittedly, at this point, I would simply throw my hands up in despair if
asked to do it by hand. On the other hand, I don't how complex (or simple)
this sort of geometry really is.
Can anyone shed a bit of light on this?
You can point me to the documentation if it's already explained there. If
trace works in the same way as as the raytracing algorithm (which I'm
beginning to suspect) I'll have to make a thorough study of it.


BTW: Is trace generally considered an "advanced" povray function.  I didn't
find it difficult to use as I already knew what a normal vector was from
high-school geometry but I've noticed that the normal vector is the part
that most-often throws people.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.