home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / graphics / 14293 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  75.0 KB

  1. Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!Germany.EU.net!gmd.de!newsserver.jvnc.net!louie!udel!gatech!hubcap!ncrcae!ncrhub2!ncrgw2!psinntp!eye!erich
  2. From: erich@eye.com (Eric Haines)
  3. Newsgroups: comp.graphics
  4. Subject: Ray Tracing News, volume 6, number 1
  5. Message-ID: <1993Jan27.115421.24071@eye.com>
  6. Date: Wed, 27 Jan 93 16:54:21 GMT
  7. Summary: here's the monster...
  8. Sender: erich@eye.com (Eric Haines)
  9. Organization: 3D/EYE, Inc.  Ithaca, NY
  10. Lines: 1555
  11.  
  12. Boy, editing on my home PC sucks rocks, but I'm finally done.  Here's the latest
  13.  
  14.  _ __                 ______                         _ __
  15. ' )  )                  /                           ' )  )
  16.  /--' __.  __  ,     --/ __  __.  _. o ____  _,      /  / _  , , , _
  17. /  \_(_/|_/ (_/_    (_/ / (_(_/|_(__<_/ / <_(_)_    /  (_</_(_(_/_/_)_
  18.          /                               /|
  19.         '                               |/
  20.  
  21.             "Light Makes Right"
  22.  
  23.              January 27, 1993
  24.             Volume 6, Number 1
  25.  
  26. Compiled by Eric Haines, 3D/Eye Inc, 2359 Triphammer Rd, Ithaca, NY 14850
  27.     erich@eye.com
  28. All contents are copyright (c) 1993 by the individual authors
  29. Archive locations: anonymous FTP at princeton.edu (128.112.128.1)
  30.     /pub/Graphics/RTNews, wuarchive.wustl.edu:/graphics/graphics/RTNews,
  31.     and many others.
  32.  
  33. Contents:
  34.     Introduction
  35.     New People, New Places, etc
  36.     An Easily Implemented Ray Tracing Speedup, by Steve Worley
  37.     Color Storage, by Greg Ward
  38.     Bounding Areas for Ray/Polygon Intersection, by Steve Worley and
  39.         Eric Haines
  40.     Simple, Fast Triangle Intersection, by Chris Green and Steve Worley
  41.     Ray Tracing Roundup
  42.     Spectrum Overview, edited by Nick Fotis
  43.     Comments on the Glazing Trick, by Eric Haines
  44.     ==== Net cullings follow ===============================================
  45.     Announcing the ACM SIGGRAPH Online Bibliography Project, by Stephen Spencer
  46.     A Brief History of Blobby Modeling, by Paul Heckbert
  47.     Cool Raytracing Ideas, Karen Paik
  48.     Optical Effects and Accuracy, by Sam Uselton
  49.     Map Projections Reference Book, by Mike Goss
  50.     A Brief Review of Playmation, by Chris Williams
  51.     PV3D Quick Review, by David Anjo
  52.     Bounding Volumes (Sphere vs. Box), by Tom Wilson
  53.     Raytracing Swept Objects, by Mark Podlipec
  54.     Ray Transformation, by Kendall Bennett
  55.  
  56. -------------------------------------------------------------------------------
  57.  
  58. Introduction
  59.  
  60. This issue seems to have a theme of efficiency hacking.  It's interesting to
  61. note that there are still many "engineering" details which have not been worked
  62. out (or at least are not commonly available).  Some of the articles here talk
  63. about ways to polish common algorithms (bounding volume testing, polygon
  64. testing) that makes them noticeably faster.
  65.  
  66. On a related note, recently I received a note from Ken Sykes at Microsoft.  He
  67. had sped up the rgbvary.c code in Graphics Gems III by using integers instead
  68. of floating point.  Doing this reduced filtering time by a factor of 8 on his
  69. PC.  He wished more publicly available code used integer arithmetic when
  70. possible.
  71.  
  72. The ray tracing roundup in this issue shows that people are quite busy out
  73. there.  I've broadened the bounds of the column a bit to include other
  74. rendering related releases, since the dividing line between ray tracing and
  75. other algorithms is not particularly sharp nor important (for example, you may
  76. preview a ray trace with a z-buffer algorithm, or use scanline methods to
  77. accelerate your ray tracer).
  78.  
  79. -------------------------------------------------------------------------------
  80.  
  81. New People, New Places, etc
  82.  
  83. George Simiakakis
  84. SYS PG
  85. University of East Anglia
  86. Norwich NR4 7TJ
  87. England
  88. A118@CPC865.EAST-ANGLIA.AC.UK
  89.  
  90. Interests : subdivision techniques, radiosity
  91.  
  92. For the moment I am investigating 5D subdivision techniques for ray tracing.
  93. Starting from the Ray Classification algorithm I am trying to come up with a
  94. more efficient algorithm with less variance in it's performance.  The main
  95. ways of doing that are adaptive choice of subdivision parameters and
  96. degeneration of 5D subdivision to spatial subdivision where this is
  97. appropriate.
  98.  
  99. -------------------------------------------------------------------------------
  100.  
  101. An Easily Implemented Ray Tracing Speedup, by Steve Worley
  102.     (spworley@netcom.com)
  103.  
  104. Most ray tracing acceleration methods are variants of just a few simple ideas
  105. that somehow presort space to minimize the number of objects that must be
  106. tested for intersection.  Grids (uniform and non-uniform), octrees, and
  107. hierarchical bounding boxes are probably the most common methods though there
  108. are of course many more.
  109.  
  110. Grids and octrees are certainly the most popular, and they do quite an
  111. effective job at speeding up intersections by reducing the number of candidate
  112. objects that the ray might hit.  More speed is always better, of course, so
  113. there are always variants of these methods usually with a time speedup at the
  114. expense of storage, preprocessing, and/or programming complexity.
  115.  
  116. I've thought up a small, quick, trick that can be included in almost any
  117. grid-type sorting algorithm.  It trades off storage space for a decent
  118. speedup, but its biggest charm is very easy implementation.  Modification of
  119. your favorite grid-sorting algorithm is probably only an hour or two of work.
  120.  
  121. The trick is based on the observation that the number of "cubes" that a ray
  122. passes through per unit length is a function of the direction of the ray.  A
  123. uniform unit-sized grid aligned along the world axes is the easiest
  124. demonstration of this, though it works for non-uniform grids and octrees too.
  125. If a ray is pointed straight along the X axis, it will obviously "skewer" an
  126. entire row of cubes.  At a distance of n units, the ray has passed through n
  127. unit cubes.
  128.  
  129. If the ray's direction is different, though, it passes through MORE cubes.  At
  130. a 45 degree angle ( the unit vector is xn=0.707 yn=0.707 zn=0.0), the ray will
  131. have moved an x distance of 0.707*n units and a y distance of 0.707*n units.
  132. It has passed through a total of 1.414*n cubes!  [This is correct:  A ray will
  133. only pass from one cube to a cube that it shares a face with.  Most algorithms
  134. never even check for a diagonal step, since this has a vanishingly small
  135. probability when you're dealing with floating point numbers.  For example, a
  136. ray going from cube 0,0 to cube 1,1 might go from 0,0 to 0,1 to 1,1 and not
  137. straight from 0,0 to 1,1.]
  138.  
  139. The number of unit cubes a ray passes through (at the limit of n large) is
  140. just the sum of the absolute x,y,and z distances the ray traverses.  The
  141. important thing to notice is that the volume of space that contains objects
  142. that need to be tested for intersection with the ray is directly proportional
  143. to this number of cubes.  The more cubes the ray passes through, the more
  144. intersections you'll probably have to do.  It is therefore "cheaper" to test a
  145. ray that moves right along an axis, which passes through one cube per unit
  146. length, than one that moves at a perfect diagonal along the lattice (from 0 0
  147. 0 to the direction 1 1 1 ) which passes through 1.703 cubes per unit length.
  148. THIS WORST CASE HAS TO TEST 70% MORE VOLUME (AND OBJECTS) THAN THE BEST CASE.
  149. This is all due simply to the direction of the ray as compared to the
  150. coordinate system of the grid.  I wrote a quick program to find the "average"
  151. case, which was about 1.3 cubes per unit length, assuming all ray directions
  152. were equally likely.
  153.  
  154. My algorithm enhancement is based on this grid orientation dependency.  The
  155. basic idea is simple:  just make one (or more) EXTRA grids with the same
  156. objects, but with the grids at an angle to the original grid.  To test a ray
  157. with the objects in the world, you just choose which grid is most "aligned"
  158. with the ray along any axis.  This "best" alignment can be determined quickly
  159. and simply by looking at the (normalized) ray direction in each grid's
  160. coordinate system.  The function [fabs(xn)+fabs(yn)+fabs(zn)] tells you the
  161. number of cubes per unit length that the ray will pass through.  The smaller
  162. this number the better, since less volume (and on the average less objects)
  163. will have to be tested.
  164.  
  165. Storage requirements are obviously increased:  two grids take twice the room
  166. of one.  [Always a trade off!]  But usually the grids aren't THAT large, since
  167. they just store lists of object ID's and not the actual objects themselves.
  168. The time to assemble the grid is obviously increased but I found that it was
  169. easy to modify the loop that decides what box(es) each object goes into so
  170. that it did all of the grids simultaneously with the same loop.  For two
  171. grids, it increased preprocessing time by about 70%.
  172.  
  173. What kind of overall speedup is expected?  Well, the more grids (at different
  174. angles) that are used, the better your ray-alignment will be on average,
  175. meaning fewer cubes will have to be tested.  The testing to determine which
  176. set of boxes to use takes a trivial amount of extra time, but the extra
  177. preprocessing to make the grids IS significant.  Also, there will STILL be
  178. inefficiency:  every ray can't always be directly along an axis of one of the
  179. grids.  I implemented a two grid and a four grid model.  Though I didn't spend
  180. a whole lot of time in optimization, the four grid method was horrible:  the
  181. preprocessing step took far too long for a scene with about 1000 objects,
  182. slowing down the overall render time.  For two grids (the second grid rotated
  183. at a 45, 45, 45 degree angle, you know what I mean), the speedup was evident:
  184. Preprocessing was about 170% of the old time, but actual rendering was about
  185. 25% faster.  Depending on how many objects were being traced, the overall
  186. speedup was from 0% to 20%.  This is in no way a revolutionary speedup, but
  187. for about two hours of programming it is not bad!  Also, these numbers are
  188. based on a non-optimized program, and can only get better if I do a more
  189. careful implementation.
  190.  
  191. Why wasn't the rendering speedup more than 25%?  A couple of reasons.  The
  192. biggest is that when a ray passes though more volume, there TENDS to be more
  193. objects that need to be intersected.  But there's often many objects that span
  194. adjacent boxes, and these (in a good implementation!)  are not re-tested so it
  195. doesn't matter much that the extra volume was passed though.  It depends on
  196. the object density and size:  if most objects were small compared to the box
  197. size and roughly uniformly distributed in space, the number of objects tested
  198. would correlate better with the volume of the cubes that the ray passes
  199. through.  [Which is really what we're reducing with this algorithm.]  But even
  200. when most grids are empty or have objects that span many cells, using the more
  201. "aligned" grid is never going to hurt:  testing less cells is going to be
  202. easier.
  203.  
  204. Anyway, there might be some improvements to this idea (it's only about a week
  205. old!) but it is so simple to implement that I thought I'd pass it along.
  206. I've implemented it for uniform grids (very simple but not necessarily the
  207. best!) and octrees.  I have not tried to make a non-uniform grid yet, but
  208. you'd probably have to make a modification of the cost function based on the
  209. AVERAGE x, y, and z sizes of the boxes.
  210.  
  211. If anyone implements this idea or has any new ideas, I'd like to hear about
  212. it.  Meanwhile I'll hopefully get some time to run some more accurate
  213. benchmarks.
  214.  
  215. -------------------------------------------------------------------------------
  216.  
  217. Color Storage, by Greg Ward (greg@hobbes.lbl.gov)
  218.  
  219. From the Radiance Digest, v2n4 (dedicated to questions from users of Radiance.
  220. For a free subscription, write Greg)
  221.  
  222. Jim Callahan <jmc@sioux.eel.ufl.edu> writes:
  223.     I understand that Radiance stores images as 32-Bit RGB.  How does
  224. an adjustment of exposure effect the colors displayed.  Obviously it
  225. affects the brightness of the image, but what are the differences between
  226. exposure and gamma correction? Are both needed?  If a light source is too
  227. dim, I want to know in absolute terms.
  228.  
  229.     This is a bit confusing to me because I realize that the eye is
  230. constantly readjusting its exposure.  I would like to be able to say that
  231. the image is a "realistic" simulation of a scene, but can this really be
  232. done?
  233.  
  234. ----
  235.  
  236. Greg replies:
  237.  
  238. You've touched on a very complicated issue.  The 32-bit format used in
  239. Radiance stores a common 1-byte exponent and linear (uncorrected gamma)
  240. values.  This provides better than 1% accuracy over a dynamic range of about
  241. 10^30:1, compared to about 3% accuracy over a 100:1 dynamic range for 24-bit
  242. gamma-corrected color.
  243.  
  244. Changing the exposure of a Radiance image changes only the relative brightness
  245. of the image.  Gamma correction is meaningful only in the presence of a
  246. monitor or display device with a power law response function.  Gamma
  247. correction is an imperfect attempt to compensate for this response function to
  248. get back linear radiances.  Thus, applying the proper gamma correction for
  249. your monitor merely gives you a linear correlation between CRT radiance and
  250. the radiance value calculated.  (Radiance is named after the value it
  251. calculates, in case you didn't already know.)
  252.  
  253. However, as you correctly pointed out, linear radiances are not necessarily
  254. what you want to have displayed.  Since the dynamic range of a CRT is limited
  255. to less than 100:1 in most environments, mapping calculated radiances to such
  256. a small range of dispayable values does not necessarily evoke the same
  257. response from the viewer that the actual scene would.  The film industry has
  258. known this for many years, and has a host of processing and exposure
  259. techniques for dealing with the problem.  Even though computer graphics
  260. provides us with much greater flexibility in designing our input to output
  261. radiance mapping, we have only just begun to consider the problem, and it has
  262. not gotten nearly the attention it deserves.  (If you are interested in
  263. learning more on the topic, I suggest you check out the excellent CG+A article
  264. [not out yet, should be good. - EAH] and longer Georgia Tech technical report
  265. by Jack Tumblin and Holly Rushmeier.)
  266.  
  267. Color is an even stickier problem.  Gary Meyer and others have explored a
  268. little the problem of mapping out-of-gamut colors to a CRT, but offhand I
  269. don't know what work has been done on handling clipped (over-bright) values.
  270. This is another interesting perceptual issue ripe for exploration.
  271.  
  272. The best you can currently claim for a computer graphics rendering is that
  273. photography would produce similar results.  Combined with accurate luminance
  274. calculations, this should be enough to convince most people.  In absolute
  275. terms, the only way to know is by understanding lighting design and
  276. luminance/illuminance levels appropriate to the task.  It will be many years
  277. before we will have displays capable of SHOWING us unambiguously whether or
  278. not a given lighting level is adequate.
  279.  
  280. [Graphics Gems II has an article "Real Pixels" and code by Greg Ward for using
  281. 32 bit format for RGB.  The on-line distribution has more code than the book,
  282. as I recall.  - EAH]
  283.  
  284. -------------------------------------------------------------------------------
  285.  
  286. Bounding Areas for Ray/Polygon Intersection, by Steve Worley
  287.     (spworley@netcom.com) and Eric Haines (erich@eye.com)
  288.  
  289. The last issue of RTN (v5n3) was devoted to fast methods of intersecting rays
  290. with polygons and particularly the subtask of determining whether a single
  291. point was inside a 2D polygon.  We (Eric and Steve) have been discussing
  292. another aspect of polygon intersection:  the best type of bounding volume to
  293. surround polygons with, particularly complex ones that have enough sides that
  294. the "is the point in the polygon?" test gets slow.
  295.  
  296. One particularly useful trick if you do have a bounding volume around the
  297. polygon (say an axis-aligned cube) is to check the ray/plane intersection
  298. POINT with the bounding volume.  The point in volume test is very cheap (6
  299. compares) and provides a way to trivially reject hits that are far from the
  300. polygon.  This quick rejection method has been developed by several people
  301. independently, and Albert Woo has a nice description in Graphics Gems I on
  302. page 394.  The only possible danger of using this extra rejection is that that
  303. a polygon laying on an axis-aligned plane will have a bounding box with no
  304. depth, and the "ray hits box?" and/or "point in box?" algorithms need to be
  305. robust enough to correctly handle it.
  306.  
  307. The method is therefore:
  308.  
  309.   1) Test to see if plane's normal is facing you (50% culling right here!)
  310.   2) Test to see if ray intersects bounding cube at all
  311.   3) Intersect the ray with polygon's plane
  312.   4) Test intersection POINT with bounding cube
  313.   5) Test intersection point for in/out polygon
  314.  
  315. But what if you eliminated the ray/bounding cube test (#2) completely and for
  316. ALL (facing) polygons you computed the ray/plane intersection and tested that
  317. point with the bounds?  If you count up the ray/bounding box test's costs, you
  318. need 3 adds, 3 divides, and 13 compares (This is from Woo's algorithm in GG
  319. I.)  But intersection with a plane only costs 5 adds, 5 mults, and 2 compares,
  320. since you already computed the dot product to test whether the plane was
  321. facing you or not.  So basically you can skip right ahead to the "is the
  322. ray/plane intersection POINT in the bounding box" (which provides better
  323. rejection than the ray/cube intersection) and you'll be ahead speed-wise.
  324.  
  325. Now here's a neat trick:  if you're now JUST using the bounding volume to
  326. provide point rejection (not ray rejection) we might as well do it ONLY in the
  327. 2D projected plane we also do our in-out tests in.  We don't even have to
  328. compute that third component (the one we don't use for testing polygon in/out
  329. anyway,) saving a mult or two.  We basically have a 2D bounding AREA and not a
  330. bounding volume.  The third coordinate did provide some additional rejection,
  331. but how effective it is depends on the plane's angle:  the Z coordinate is a
  332. linear function of X and Y.  This also avoids any ugliness from a zero-height
  333. bounding box.
  334.  
  335. The bounding AREA will do a fast rejection of trivial points far away from the
  336. center of interest.  RTNv5n3 had several discussions of different test
  337. methods, but all of them might be helped by this trivial rejection depending
  338. on the complexity of the polygon.  (Any bounding for a triangle is probably a
  339. waste, but if you have a 500 sided polygon, doing at least a gross rejection
  340. of far off points is going to be a severe win.)
  341.  
  342. NOTE:  This does not mean that a bounding volume is necessarily a bad idea for
  343. a polygonal object!  It DOES mean that a bounding volume for a SINGLE polygon
  344. is definitely slower than doing a 2D point rejection instead.
  345.  
  346. The question is for these complex-enough polygons, what type of rejection to
  347. use?  (The rest of this discussion assumes the XY plane is the plane being
  348. used for the polygon test, but XZ or YZ are obviously just the same.)  The
  349. bounding square (max/min X,Y) is by far the most obvious and useful, since it
  350. only costs 4 compares and will reject all of the way-off hits.  A tighter
  351. bound might be useful for a more complex figure, however.  One logical further
  352. test would be to measure the maximum extents of the polygon along other
  353. directions such as the 45 and 135 degree angles:  you sort of get a tight
  354. shrink-wrapped octagon bounding your polygon.
  355.  
  356. If you want to check the 45 degree angles, you do a separate min/max test on
  357. the value sqrt(1/2)*X+sqrt(1/2)*Y, which is just a coordinate rotation of the
  358. point by 45 degrees.  The 135 degree rotation is done by testing
  359. sqrt(1/2)*X-sqrt(1/2)*Y.  The extra 4 rejections therefore cost 2 adds, 4
  360. mults, and 2 compares.
  361.  
  362. Now here's a really sneaky trick:  What if you change to an *UNNORMALIZED*
  363. coordinate system.  Don't check sqrt(1/2)*X+sqrt(1/2)*Y, check instead X+Y!
  364. The maximum extent you're checking against absorbs that normalization
  365. constant, but that is the only thing you ever use these min/max numbers for so
  366. it is not a problem.
  367.  
  368. So to evaluate the shrink wrapped octagon, you:
  369.  
  370.  1) Check min/max X span                 2 compares
  371.  2) Check min/max Y span                 2 compares
  372.  3) Compute A=X+Y                        1 add
  373.  4) Check min/max A span                 2 compares
  374.  5) Compute B=X-Y                        1 add
  375.  6) Check min/max B span                 2 compares
  376.  
  377. You could continue into 16 sided shrinkwrapped hulls if you really need to
  378. (C=A+X D=B+X E=A+Y F=B-Y) but this is probably tight enough for anybody.
  379.  
  380. This type of bounding box is useful for other types of point sampling as well;
  381. solid texturing evaluates functions of a single point and they often have a
  382. region where a color or pattern is applied to a central location and outlying
  383. areas are left alone or colored with a background.  A 16 sided bounding volume
  384. (this time in 3D) only takes 16 compares and 6 adds (by coincidence, the same
  385. as 2D.)  This has been implemented in several textures, in particular one that
  386. renders Bezier outline fonts on an object's surface.
  387.  
  388. ---
  389.  
  390. A very different method for trivial rejection of 2D points takes much more
  391. precomputation but has the additional benefit of trivial ACCEPTANCE.
  392. Basically, you impose a uniform grid onto the XY plane and classify each box
  393. in the grid as inside, outside, or indeterminate.  Only when a point lies in
  394. an "indeterminate" box does the full point-in-polygon routine need to be
  395. called.  Any point that falls outside the grid is automatically rejected.
  396. (The grid is sized to just fit over the polygon.)  This method is especially
  397. effective for many-sided but simple polygons that have a lot of "empty" inner
  398. area since any hits on the inside away from the edges are quickly accepted.
  399.  
  400. This grid isn't too hard to make.  You "render" each polygon segment into the
  401. grid, marking any boxes the line touches with an ID meaning "indeterminate."
  402. Flood fill any untouched boxes that lie along the outside edge of the grid
  403. (using the N S E W neighbors) with a flag saying "outside."  Then use the
  404. "point in polygon" routine in the center of each of the remaining untouched
  405. squares to determine its state, inside or outside.  When you determine a new
  406. square, you can flood fill its unchecked neighbors.  This all works since the
  407. only indeterminate boxes are the ones that edges pass through, and an edge
  408. (and therefore an "indeterminate" box) will always separate any transition
  409. between inside and outside.  This will work for either winding number or
  410. even-odd methods of point-in-polygon definition.
  411.  
  412. The lookup grid is expensive in terms of memory, but the speedup can be
  413. significant especially for large or complex polygons.  Each box in the grid
  414. needs two bits of storage since there are three possibilities to choose from.
  415. A cheaper but slower alternative is to use only one bit to encode the
  416. in/out/indeterminate state.  During precompute, count up the number of boxes
  417. for acceptance and rejection, and encode the less common state as
  418. indeterminate.
  419.  
  420. [I have implemented this algorithm and it works very well, giving you near
  421. O(1) performance for "reasonable" data.  I used the outlines of continents for
  422. my polygons (from 164 to 1152 points) and had good results.  This algorithm
  423. would probably be good for GIS applications.  The indeterminate cells can be
  424. evaluated much faster by noting which edges actually pass through the cell.
  425. Since you know the state of the corners of the cell (i.e. each corner is in
  426. or out), you draw a line segment from your test point to the nearest cell
  427. corner (or any corner, but the nearest should have less crossings).  Using the
  428. ideas of Mukesh Prasad in Graphics Gems II for line segment intersection
  429. testing, you can quickly find how many crossings occur between the test point
  430. and the cell corner and so know the test point's status.  - EAH]
  431.  
  432. One implementation danger is in ROBUSTLY identifying each square in the lookup
  433. grid that any edge passes though.  A vertical or horizontal polygon edge might
  434. lie right along the borders of a square in the lookup grid, or less commonly,
  435. a line might pass diagonally through a corner of one of the squares of the
  436. grid.  In both cases it is probably best to be conservative and identify the
  437. adjoining square(s) as indeterminate.
  438.  
  439. One modification of this algorithm can speed it up further.  Instead of
  440. recording just three states in the look-up grid, a fourth state meaning
  441. "unprocessed" is added.  During precomputation, you mark all of the
  442. "indeterminate" squares as before, but you don't do anything else.  (Your grid
  443. after pre-computation will therefore be filled only with "indeterminate" and
  444. "unprocessed" squares.)  When you begin rendering, you use the grid as before,
  445. but when you hit an "unprocessed" square, you do the point-in-polygon test,
  446. record the answer in the grid, do the flood-fill of the neighbors, and return
  447. the correct answer.  This method is a little bit more complex to implement,
  448. but you'll only end up doing the minimum amount of work building the grid
  449. since you set it up partially "on demand."
  450.  
  451. ----
  452.  
  453. These bounding area methods are useful complements to the point-in-polygon
  454. test.  They provide quick rejections (or acceptances) the number of times that
  455. the (relatively) slow point in polygon routine is called, exactly the same way
  456. that a bounding volume can provide quick rejection of ray/object
  457. intersections.
  458.  
  459. -------------------------------------------------------------------------------
  460.  
  461. Simple, Fast Triangle Intersection, by Chris Green
  462.     (chrisg@cbmvax.cbm.commodore.com) and Steve Worley
  463.     (spworley@netcom.com)
  464.  
  465. Chris writes about RTNv5n3:
  466.  
  467.     I am always surprised to see articles advocating angle tests,
  468. intersection counting, or Barycentric coordinates for determining if an
  469. intersection point is inside of a 3d dimensional triangle, when the simple way
  470. of determining this is also the fastest, if you can live with a few more bytes
  471. stored per triangle.
  472.  
  473. My Method:
  474.  
  475.     Store with each triangle 2 indices, i1 and i2.  These are the
  476. coordinate offsets for the two axes that will be considered in the test.  (the
  477. axis with the largest component in the normal vector is dropped, as usual).
  478. Store the 2 coefficients and the 1 constant of the "inside-outside" equation
  479. of each edge.
  480.  
  481.     To test for intersection, calculate C[0]*X[i1]+C[1]*X[i2]+C[2] (X is
  482. the intersection coordinate, and C are the 3 constants for the linear equation
  483. calculated at setup time) over all 3 edges.  If any of them have a negative
  484. (or positive depending upon which convention you choose) result, return
  485. NO_INTERSECTION.
  486.  
  487.     Assuming hardware multiply, this can be coded extremely efficiently,
  488. and can take advantage of multiply-accumulate instructions if they are
  489. available.  In fact, with a fast MAC instruction, it might be more efficient
  490. to skip the coordinate indexing all together and just use the 3d equation of
  491. the plane passing through the edge perpendicular to the triangle on some
  492. architectures.
  493.  
  494.     The only further optimization I take is that I store the edge
  495. equations sorted by the area of the 2d bounding volume of the triangle which
  496. is outside of that edge.
  497.  
  498.     In 68040 code, this all boils down to:
  499.  
  500.     move.l  0(a5,d6.w),d4           ; d6=i1, a5 = &intersection point
  501.     move.l  0(a5,d7.w),d3           ; d7=i2
  502.     muls.l  (a4)+,d0:d4             ; C0*X1
  503.     muls.l  (a4)+,d1:d3             ; C1*X2
  504.     add.l   d3,d4
  505.     addx.l  d1,d0                   ; C0*X1+c1*x2
  506.     movem.l (a4)+,d1/d3             ; fetch 64 bit constant term
  507.     add.l   d3,d4
  508.     addx.l  d1,d0                   ; c0*x1+c1*x2+c2
  509.     bmi.s   no_hit3                 ; outside?
  510.  
  511.     repeated 3 times.
  512.  
  513. --------
  514.  
  515. Reply from Eric Haines:
  516.  
  517.     I'll put your note in the next RTN - thanks.  Berlin, in the truly
  518. obscure reference
  519.  
  520. %A E.P. Berlin, Jr.
  521. %T Efficiency Considerations in Image Synthesis
  522. %B SIGGRAPH '85 course notes, volume 11
  523. %D July 1985
  524. %K polygon intersection
  525.  
  526. gives the same method you do (he thinks of it as three planes).  I assume that
  527. your method works for convex polygons only, unless you test all triangles
  528. within the polygon and check the parity [see RTNv5n3 for more information].
  529.  
  530.     The catch is, most people don't code in assembler (the counting
  531. crossings test is darned fast in assembler).  However, your test is darned
  532. fast anyway, at least for simple polygons.  The extra memory is something of a
  533. drawback, but who can complain?
  534.  
  535.     I coded it up (looked pretty efficient) and tried it in my test suite.
  536. Here are the results:
  537.  
  538. For random polygons:
  539.  
  540.              Number of vertices
  541.             3       4       5       3-7     20      100
  542.  
  543. plane               1.15    1.88    2.81    2.91   16.10   87.02
  544. macmartin           1.90    2.33    2.76    2.67   10.63   51.47
  545.  
  546. inside %            6.78   11.78   13.11   12.22   26.22   35.67
  547.  
  548.  
  549. For regular polygons:
  550.  
  551.              Number of vertices
  552.             3       4       5       3-7     20      100
  553.  
  554. plane               1.22    2.23    3.25    3.36   16.67   86.51
  555. macmartin           2.33    2.80    3.03    3.10    6.31   23.78
  556.  
  557. inside %           33.22   51.00   60.22   55.22   77.44   80.22
  558.  
  559.  
  560. Admittedly, for the regular polygons I could do the test for the plane set
  561. based on "first hit means quit", since the regular polygons are convex.  This
  562. will result in faster timings for it (as it would for the macmartin tests:  if
  563. two crossings are found while doing the macmartin test for convex polygons,
  564. then you can quit).  It's cool that your test is better for 3 and 4 vertex
  565. polygons, since these are real common.
  566.  
  567. --------
  568.  
  569. Chris replies:
  570.  
  571.     Thinking about my method applied to polygons with large (>4) numbers
  572. of sides, I realized that the edge equations should be stored in bit-reversed
  573. order, assuming some bounding volume that reduces PIP tests to only those
  574. points which are somewhat near the polygon, and also assuming most polygons
  575. are relatively regular.
  576.  
  577.     Imagine an octagon surrounded by a rough bounding box.  If the first
  578. side didn't clip off the point, the 2nd isn't that likely to if it is at a
  579. similar angle to the first one.  But the opposite side is more likely to.  The
  580. optimal thing to do is to calculate the area which is inside the bounding box
  581. which has not yet been clipped off by one of the previous edges, but this
  582. would involve calculating intersections of the edges with each other, which is
  583. probably too much work to do on a polygon which might only cover 10 pixels on
  584. the output image.
  585.  
  586.     The algorithm is to check the point against the edge equations of each
  587. edge of the convex polygon (the "inside-outside" equation of the edge).  i.e:
  588.  
  589.     if v0 is one vertex and v1 is another, and v2 is another point on the
  590.     polygon,
  591.  
  592.     a=v1.x-v0.x
  593.     b=-(v1.y-v0.y)
  594.     c=-(a*v1.x+b*v1.y)
  595.  
  596.     if (a*v2.x+b*v2.y+c>0) then negate a,b,c to make the inside-outside
  597.      sense correct.
  598.  
  599.     Which coordinate x and y are depends, of course, upon the surface
  600.     normal of the triangle.
  601.  
  602. intersect:
  603.  
  604.     x,y=intersection point of ray and plane projected onto the correct axis.
  605.  
  606.     for(each edge)
  607.         if (x*a[i]+y*b[i]+c[i] >0) then no_intersection
  608.  
  609. All the abc[i]'s are sorted in such a way (based upon the bounding volume) so
  610. as to make the probability high that the first test will reject the point.
  611. For a many-sided (roughly regular) convex polygon, storing the sides in bit
  612. reversed order (for an 8 sided polygon this is 0,4,2,6,1,5,3,7) causes the
  613. loop above to test the point against a bounding volume which "homes-in" on
  614. the actual shape of the polygon.  For a triangle, I store the sides based upon
  615. the area of the triangle cut out by the intersection of the edge and the
  616. bounding box.
  617.  
  618. ----
  619.  
  620. Steve Worley (spworley@netcom.com) had some independent observations, also
  621. realizing that half-plane testing should be fast:
  622.  
  623. In RTNv5n3, Peter Shirley wrote about a fast triangle test using barycentric
  624. coordinates.  It seems to me that the fastest method (by far!) to test
  625. whether a point is in a 2D triangle is to just do three half-plane tests.
  626. Represent each of the lines that make up the triangle with two real numbers A
  627. and B such that the line is described by the formula Ax+By=1.  If the triangle
  628. lies below that line, a point on the "wrong" side of the line will satisfy the
  629. inequality Ax+By>1.  If the triangle is "above" the line, you just test
  630. Ax+By<1 instead.  You do this test for each of the three triangle sides, and
  631. immediately return if it fails at any time.  If it passes all three tests, the
  632. point is in the triangle.  The computational cost is two multiplies, an add,
  633. and two compares for each test, so worst case cost is 6 mults, 3 adds, 6
  634. compares.  However, you're more likely to get rejected on the first tests, and
  635. the mean amount of computation for a completely random triangle turns out to
  636. be exactly 3.5 mults, 1.75 adds, and 3.5 compares.
  637.  
  638. A slightly faster method would be to write each line in the form Cx+y=D
  639. instead, which would save a multiply on each test.  However this causes a
  640. problem because of perfectly vertical lines which would make C and D become
  641. infinite.  An extra compare would be needed to check for this case so that the
  642. more general Ax+By=1 test could be substituted.
  643.  
  644. While this method is probably about as fast as a 2D point in triangle test can
  645. get, Shirley's barycentric method has one big advantage in that AFTER a hit,
  646. the computed coordinates can be immediately used for Gouraud or Phong shading.
  647. Depending on the percentages of tests versus hits your application gets, it
  648. might be cheaper to use only barycentric if typical tests have a high enough
  649. hit rate.  Note also that both the barycentric and the half-plane rejection
  650. methods will work on any convex polygon.
  651.  
  652. -------------------------------------------------------------------------------
  653.  
  654. Ray Tracing Roundup
  655.  
  656. The big news is that there is now an FTP site with some excellent 3D model
  657. datasets available.  Go to avalon.chinalake.navy.mil (129.131.31.11).  If you
  658. can't reach it, or your connection is slow, the site is mirrored on
  659. ftp.kpc.com (144.52.120.9) in /pub/mirror/avalon.  The objects in
  660. obj/Viewpoint are of particularly high quality:  there's a cow, foot bones,
  661. Beethoven's bust, a brontosaurus, a toy galleon, and I forget all what else,
  662. plus many road vehicles, a helicopter, etc.  There are also the Capone
  663. datasets, in case you didn't get yours free at SIGGRAPH at the Viewpoint
  664. booth.  I liked these .obj files well enough that I even wrote an obj2nff awk
  665. script (which is also FTPable from avalon - dig around).  And this is just one
  666. set of models - there are others from many other sources.  If they're missing
  667. your favorite dataset, upload it to them.  contact:  Francisco X DeJesus
  668. (dejesus@archimedes.chinalake.navy.mil)
  669.  
  670. --------
  671.  
  672. The February 1993 issue of National Geographic has a fold-out image of Venus
  673. on page 37.  This image was rendered by David Anderson at SMU using Craig
  674. Kolb's Rayshade software.  Also, the computer firm Santa Cruz Operation is
  675. evidently using/going to use images made from public scene files by Rayshade
  676. in showing off their SCO Open Desktop.
  677.  
  678. --------
  679.  
  680. A new book on ray-tracing has come out, and comes with a disk of code for
  681. "Bob", a ray tracer (of at least 8K lines of code).  Note that Stephen Coy is
  682. also the creator of the VIVID ray tracer.  I hope to review this book for the
  683. next issue of the RTN - EAH.  It's at least 8k lines of code.
  684.  
  685.     Photorealism & Ray Tracing in C
  686.     Christopher D. Watkins, Stephen B. Coy, and Mark Finlay
  687.     M&T Books, a division of M&T Publishing, Inc.
  688.     411 Borel Avenue, Suite 100
  689.     San Mateo, CA  94402   (C) 1992
  690.     ISBN 1-55851-247-0
  691.  
  692. Some comments from Stephen Coy:
  693.  
  694. Bob, the raytracer in the book, is basically Vivid with a few, minor changes.
  695. The changes tend to center around the parser.  I didn't want to use flex and
  696. byacc for the book so I spent a long day writing the parser from scratch in C.
  697. Everything works except allowing the user to perform math functions in the
  698. input files.  I'd like to see some benchmarks with Bob vs some of the other
  699. tracers out there.  Even though it is distantly derived from MTV I think it
  700. will generally beat MTV by quite a bit.
  701.  
  702. Before you ask, the name Bob just sort of happened.  When I was working on the
  703. code I got tired of talking to Chris and calling it "the ray tracer for the
  704. book."  I suggested that we just call it Bob until we came up with a better
  705. name.  The deadlines came first.
  706.  
  707. --------
  708.  
  709. Another new book is _Practical Ray Tracing in C_ by Craig A. Lindley.  It
  710. contains a disk for the IBM PC and the ray tracer is DKB Trace.  I assume it
  711. has the same features as the PD one on the net (and vice versa).  The book is
  712. evidently a $49.95 paperback (with disk of course).  (Tom Wilson,
  713. wilson@eola.cs.ucf.edu)
  714.  
  715. [Does anyone know anything about this book?  I haven't seen it and am unwilling
  716. to blow bucks on it.  Any review (biased or no) is appreciated! - EAH]
  717.  
  718. --------
  719.  
  720. For those of you who still believe free software is worthless, a comment from
  721. a guy at NASA on Radiance [an "industrial strength" lighting simulator free
  722. from Greg Ward - a ray tracer and much more]:
  723.  
  724. By the way, your package is a very good one, in just 2 weeks we were able to
  725. trace complex space shuttle lighting very easily.  Nice work.
  726.  
  727. --------
  728.  
  729. The source code from the notes of Siggraph '92 Course 23 (Procedural Modeling
  730. and Rendering Techniques) is now available for anonymous ftp from
  731. archive.cis.ohio-state.edu as pub/siggraph92/siggraph92_C23.shar .  Without a
  732. copy of the course notes, these files may not make sense.  (David Ebert,
  733. ebert@hockey.cis.ohio-state.edu)
  734.  
  735. --------
  736.  
  737. Human heads and an anatomically correct human skull data are available.  The
  738. data is a mesh and the demo contains convert utilities to translate into
  739. various other formats, eg.  ASCII, Wavefront, IGES, etc.  The demo runs on a
  740. SGI IRIS workstation.  Ftp from taurus.cs.nps.navy.mil, login anonymous,
  741. password guest, file pub/dabro/cyberware_demo.tar.Z .  (George Dabrowski,
  742. Cyberware Labs, dabro@taurus.cs.nps.navy.mil)
  743.  
  744. --------
  745.  
  746. A simple public-domain radiosity package is available at ftp.yorku.ca (was:
  747. nexus.yorku.ca) (130.63.9.66) in /pub/reports/Radiosity_code.tar.Z (also
  748. mirrored at wuarchive.wustl.edu).  The package contains C code for a
  749. progressive refinement solution using the following algorithms:
  750.  
  751.     Wallace (Ray-traced form-factors),
  752.     Haines (Shaft Culling), using automatic hierarchical
  753.         bounding creation (Salmon 87)
  754.     Chen (Progressive refinement with jitter hemicubes)
  755.     A partial implementation of Hanrahan's BF-Refinement algorithm.
  756.  
  757. Additionally, there are model preprocessors for conversion from QuickModel and
  758. OFF formats, with geometric constraints of Baum's 91 Siggraph paper partially
  759. included; and a scene walk through program with simple Gouraud shading.  The
  760. solution can be run stand-alone on any Unix box, but the walk-through requires
  761. a SGI 4D.  (Bernard Kwok, g-kwok@cs.yorku.ca)
  762.  
  763. --------
  764.  
  765. Version 2.2 of x3d, a 3D wireframe / hidden line / hidden surface viewer that
  766. runs under X11, is now available via anonymous ftp at castlab.engr.wisc.edu
  767. (144.92.60.140) and is found as /pub/x3d.2.2.tar.Z.  (Mark Spychalla,
  768. spy@castlab.engr.wisc.edu)
  769.  
  770. --------
  771.  
  772. If you use AutoCAD 11 Advanced Modelling Extensions (AME) software to build 3D
  773. objects, it is now possible to convert these models to a raytracer compatible
  774. scene file format (SCN), which is used by the RTrace package (raytracer plus
  775. utilities).  The converter code is available at asterix.inescn.pt
  776. [192.35.246.17] in directory pub/RTrace/scene-conv/acad (files scn.h and
  777. sol2scn.h).
  778.  
  779. A MAC version of RTrace 1.0 version (beta) is available in directory
  780. pub/RTrace/Macintosh at asterix.inescn.pt [192.35.246.17] The code was made by
  781. me; Reid Judd (reid.judd@east.sun.com) and Greg Ferrar
  782. (gregt@function.mps.ohio-state.edu) made the Mac port.  (Antonio Costa,
  783. acc@asterix.inescn.pt)
  784.  
  785. --------
  786.  
  787. A new release of Tcl-SIPP is available from:
  788.  
  789.     ftp.uu.net:/graphics/3D/tsipp.3.0b.tar.Z
  790.  
  791. and should be available soon from:
  792.  
  793.     barkley.berkeley.edu:/tcl/extensions/tsipp3.0b.tar.Z
  794.  
  795. Tcl-SIPP is a 3D image specification and rendering toolkit for use with Tcl
  796. and Tk.
  797.  
  798. It provides a Tcl command interface to SIPP, the SImple Polygon Processor
  799. library.  This is used for creating 3-dimensional scenes and rendering them
  800. using a scanline z-buffer algorithm.  The Tcl interpretive programming
  801. language is used to provide a powerful, yet simple interface to this library.
  802. The scene may be written to either a PPM format file, as defined by the
  803. PBMPlus toolkit or a RLE file, as defined by the Utah Raster Toolkit.
  804.  
  805. An interface to render to the photo widget in the Tk X11 toolkit is also
  806. provided.  Events such as button presses may take place while rendering is
  807. in progress. (markd@NeoSoft.com, Mark Diekhans)
  808.  
  809. --------
  810.  
  811. Under princeton.edu:pub/Graphics/rayshade.4.0, you'll find several new
  812. directories, including:
  813.  
  814. Contrib            User-contributed enhancements, header files, etc.
  815. Amiga/DOS/MAC/OS2    Ports to various strange operating systems.
  816. Pix            Rayshade-generated images, texture maps, etc.
  817.  
  818. There have been other changes to the archive; poke around and you'll
  819. undoubtedly discover them.
  820.  
  821. ----
  822.  
  823. I've placed all of the old rayshade-users messages on the princeton archive:
  824.     princeton.edu:pub/Graphics/rayshade-users/Feb-Sep92.Z.
  825.  
  826. This file is completely unedited -- if it was sent to the list between
  827. February and September 28th, it appears here.  If some brave soul wants to
  828. edit out the chaff, I'd be happy to replace the file with something more
  829. appropriate.
  830.  
  831. ----
  832.  
  833. Utah RLE viewers for the IBM PC are available at
  834. cad0.arch.unsw.edu.au:/pub/rayshade/dos.  They include:
  835.     drawutah13.exe   SVGA Utah rle viewer.
  836.     drwrle15.exe     Utah rle viewer (Tseng Labs HiSierra 15 bit DAC).
  837.     drwrle24.exe     Utah rle viewer (Tseng Labs HiSierra 24 bit DAC).
  838. The drawutah.exe may also be available from princeton.edu.
  839.  
  840. ----
  841.  
  842. A new rsdefs package for Rayshade is available.  Changes made were:  new
  843. surfaces added (copper, several diamond, several glasses to name a few), fixed
  844. documentation -- all the examples should work now, made primitives more easy
  845. to use, added surface information file -- information for developing new
  846. surfaces (just RI values and some color info sofar), added a script for batch
  847. testing surfaces.  Larry Coffin (lcoffin@clciris.chem.umr.edu)
  848.  
  849. ----
  850.  
  851. NCSA Polyview 3.0 is now available via anonymous FTP to ftp.ncsa.uiuc.edu
  852. (141.142.20.50) in /SGI/Polyview3.0.  Polyview 3.0 is a software tool for
  853. interactive visualization and analysis of 3D geometrical structures.  Polyview
  854. 3.0 reads data files in NCSA HDF Vset format and automatically derives
  855. animation sequences based on available information.  Script-based and
  856. graphical user interfaces complement each other in a seamless fashion to allow
  857. the easy creation of movie-style animations.  Rayshade users on SGIs may be
  858. interested in this; among other things, it generates scene files in rayshade
  859. 4.0 format (and also in Pixar's RenderMan format).  (Marc Andreessen,
  860. marca@ncsa.uiuc.edu)
  861.  
  862. --------
  863.  
  864. POLYRAY is a ray tracer that is "more difficult to use but substantially
  865. faster".  Version 1.4 is available at faramir(or
  866. ftp).informatik.uni-oldenburg.de (134.106.1.9) in
  867. pub/dkbtrace/incoming/polyray.  Note that the file has probably moved
  868. somewhere by now.  This site also contains a number of POV & DKBtrace scene
  869. files and images, as well as 3d fonts for POV and Vivid (Andy Haveland,
  870. andy@osea.demon.co.uk)
  871.  
  872. --------
  873.  
  874. If you're on (or have access to) an Amiga system, then you may want to check
  875. out Vertex, a shareware ($40) 3D object editor/converter.  It will read
  876. Wavefront .obj files and save them in Imagine, Sculpt 3D, Lightwave RayShade,
  877. GEO and 3D Professional file formats.  While not perfect, it does correctly
  878. read the Wavefront geometry from the file, and you can modify smoothing and
  879. face colors right in Vertex.  (Alex_-_DeBurie@cup.portal.com)
  880.  
  881. --------
  882.  
  883. White Sands Missile Range (192.88.110.20) in pd1:<msdos.graphics> carries
  884. Thunder, a ray tracer from Germany.
  885.  
  886. --------
  887.  
  888. A 512x512x24 bit Mandrill is available in PPM and JPEG formats from
  889. popeye.genie.uottawa.ca, in /pub/pics.  (Dominic Richens,
  890. dominic@shamin.genie.uottawa.ca)
  891.  
  892. --------
  893.  
  894. The cameraman image is available via anonymous ftp from eedsp.gatech.edu in
  895. database/images/camera.256.  The file is unformatted byte format with image
  896. dimensions 256x256.  (Stan Reeves, sjreeves@eng.auburn.edu)
  897.  
  898. --------
  899.  
  900. Graphtal is a L-system interpreter, and includes a number of features,
  901. including animation support, X11 previewer, z-buffer preview, and output for
  902. rayshade.  It is in C++, and currently works on SparcStations, RS/6000's, and
  903. DEC Stations.  The first public release of graphtal is now available via
  904. anonymous ftp at iamsun.unibe.ch (130.92.64.10) and is found as
  905.     /Graphics/graphtal-1.0.tar.Z or
  906.     /Graphics/graphtal_no_bison_no_flex-1.0.tar.Z.
  907. (Christoph Streit, streit@iam.unibe.ch)
  908.  
  909. --------
  910.  
  911. The Dr. Dobb's Journal's FTP directory ftp.mv.com /pub/ddj/packages has
  912. Xsharp, a fairly fast hidden surface displayer for the IBM PC.  Source code in
  913. C and assembler is included, and Xsharp now has some simple texture mapping
  914. capabilities.
  915.  
  916. --------
  917.  
  918. The GRAPHIC CONNECTION can be reached at the following numbers:
  919.     by modem: 503-591-8412
  920.     voice:    503-591-0134
  921.     FAX:      503-244-0919
  922. V.32bis/V.42.bis MNP, 24 hours a day.
  923.  
  924. This BBS is owned and operated by Vertech Design, is located in Portland,
  925. Oregon.  TGC specializes in material/texture files, custom bitmap design,
  926. graphics utilities and programs, and specialized scanning services.  There
  927. will also be a large message base with topic specific areas for all areas of
  928. CAD and graphics support.  Need more information?  E-mail me.  - Lynn Falkow,
  929. lynnf@techbook.com
  930.  
  931. [I tried this BBS out some time ago, but had trouble getting any material
  932. texture samples - the directory which was supposed to have these publicly
  933. available was inaccessible, for some reason.  I paged the sysop, but he didn't
  934. seem to know what was wrong, either.  - EAH]
  935.  
  936. --------
  937.  
  938. For 3D stereo supplies, one source is Reel 3D's mail order catalog:
  939.     Reel 3-D Enterprises, Inc.
  940.     P.O. Box 2368
  941.     Culver City
  942.     CA 90231
  943.     Phone (310)837-2368
  944.     Fax   (310)558-1653
  945. (Alexander Klein, editor of 3D-MAGAZIN, klein@nadia.stgt.sub.org)
  946.  
  947. --------
  948.  
  949. ftp.rahul.net [192.160.13.1]:/pub/bryanw has a number of programs related to
  950. JPEG and MPEG generation and display.  (Bryan Woodworth, bryanw@rahul.net)
  951.  
  952. --------
  953.  
  954. VIS-5D is a system for interactive visualization of 5-D gridded data sets such
  955. as those made by numeric weather models.  One can make isosurfaces, contour
  956. line slices, colored slices, wind vector slices, wind trajectories, etc.  of
  957. data in a 3-D grid and then rotate and animate the image in realtime.  There
  958. are also features for text annotation and video production.  Systems
  959. supported:  SGI, IBM RS/6000, Stardent/Stellar.  FTP from iris.ssec.wisc.edu
  960. (144.92.108.63).  It is also available on wuarchive.wustl.edu in the directory
  961. graphics/graphics/packages.  (brianp@ssec.wisc.edu, Brian Paul)
  962.  
  963. --------
  964.  
  965. Disc-1 Graphics- is a collection of more than 426 MegaBytes of popular public
  966. domain, shareware, and freeware graphics programs and data files.  The disc
  967. contains more than 1200 programs, 16,000 files.  The cost of the disc is
  968. $24.95 plus $5 to cover shipping and handling ($15 overseas).  Orders may be
  969. FAXed to (916)-872-3826.
  970. Prepaid orders may be mailed to : Knowledge Media
  971.                   436 Nunnelley Rd. Suite B
  972.                   Paradise,CA 95969, USA
  973. (Paul Benson, pbenson@cscihp.ecst.csuchico.edu)
  974.  
  975. --------
  976.  
  977. The Copyright Guide from the ASMP (American Society of Media Photographers) is
  978. available in digital form now.  FTP from ftp.eff.org:
  979. pub/cud/papers/asmp-guide, or ftp.ee.mu.oz.au:
  980. pub/text/CuD/papers/asmp-guide.Z, or ftp.moink.nmsu.edu.  Although written
  981. from a photographers perspective the Guide might help to clear up a few points
  982. of confusion about copyright protection of images.  (Don Smith,
  983. dsp@halcyon.com)
  984.  
  985. -------------------------------------------------------------------------------
  986.  
  987. Spectrum Overview, edited by Nick Fotis
  988.  
  989. Here's a glimpse of the SPECTRUM rendering testbed proposed by A.Glassner in
  990. the Frontiers In Resdering Course Note 12 from SIGGRAPH '91:
  991.  
  992. "... the architecture supports the following features:
  993.  
  994. o       Standard radiosity and distribution ray tracing features (energy
  995.     balancing, soft shadows, depth of field, motion blur, spectral
  996.     sampling, etc.)
  997.  
  998. o    User control of most rendering parameters (with defaults)
  999.  
  1000. o    Programmable shaders, selected by the user in run time (including
  1001.     textures)
  1002.  
  1003. o       Programmable sampling techniques.  Any sampling strategy may be used,
  1004.     including (bu not limited to) staticc or adaptive, uniform or noisy.
  1005.     Any sampler may be used to draw samples on any two-dimensional
  1006.     distribution.  Higher-dimensional samplers may be used as well.
  1007.  
  1008. [nfotis: I think that would be a better idea to separate rendering and
  1009.  reconstruction, as G.Ward does with Radiance]
  1010.  
  1011. o    Programmable reconstruction techniques, appropriate for any two-
  1012.     dimensional signal, such as illumination spheres and screen images.
  1013.  
  1014. o    Programmable radiation patterns for light emitters.
  1015.  
  1016. o    Programmable cameras, selected by the user at run time.
  1017.  
  1018. o    Easily-extended object and meta-object classes.
  1019.  
  1020. o    Still and animated sequence rendering.
  1021.  
  1022. o    Any geometric object may be a light emitter.
  1023.  
  1024. o       Sampling and reconstruction are techniques unified across screen and
  1025.     object domains.  All sampling procedures are interchangeable, whether
  1026.     they are sampling the image plane, the illumination arriving at an
  1027.     object surface, the texture of a region, etc.  Similarly,
  1028.     reconstruction techniques, are equally, generic and applicable to all
  1029.     domains.  A sampler is simply considered a technique for gathering
  1030.     information on a two-dimensional distribution.  Callback procedures
  1031.     are used to control a sampler for the different purposes of screen
  1032.     sampling, shading, texturing, etc.
  1033.  
  1034. o       Shaders receive as input a description of the illumination sphere.
  1035.     They are not responsible for determining the incident illumination at
  1036.     a point, and they may reconstruct a sampled illumination signal before
  1037.     processing.
  1038.  
  1039. o       The incident illumination sphere is described as a collection of
  1040.     samples of the incident light.  Typically, one determines this sphere
  1041.     by first building a set of samples that are directed to light-emitting
  1042.     objects; they return the color of the light foud along the ray,
  1043.     whether it actually reached a light emitter or not.  Then this set may
  1044.     be passed to an adaptive sampler as a "seed", or starting signal.
  1045.     This increases the likelihood that light emitters are sampled, and
  1046.     allows the incident illumination sphere to be adaptively sampled until
  1047.     the sampled signal meets the criteria for that sampler.  This
  1048.     illumination sphere is then passed to a shader for modulation vy the
  1049.     bidirectional reflectance distribution function of the surface at this
  1050.     point.
  1051.  
  1052. o       Objects may be queried by a shader for information.  This contrasts
  1053.     with the Renderman model, where a shader may expect a number of
  1054.     variables to be precomputed and available.  Since the shaders in this
  1055.     system are not precompiled from a special-purpose language, if is
  1056.     difficult to determine a priori what information a shader requires
  1057.     from an object.  Thus each object contains a procedure that accepts a
  1058.     request from a shader in the form of a list of requested geometric
  1059.     values, and returns the relevant information.  There is a performance
  1060.     penalty for this process, but it only occurs once per shading point.
  1061.     I consider that the extra overhead to parse the request list is
  1062.     compensated by the time saved by not calculating unnecessary values.
  1063.  
  1064. o       Colors may be specified in a variety of formats, including spectral
  1065.     distributions.
  1066.  
  1067. o       Meta-objects (accelerators, CSG trees, abstract structures, etc.) are
  1068.     considered "first-class".
  1069.  
  1070. -------------------------------------------------------------------------------
  1071.  
  1072. Comments on the Glazing Trick, by Eric Haines (erich@eye.com)
  1073.  
  1074. Hans Kilian (iqkili@cbs.dk) writes:
  1075. >In vol. 5 issue 1, in 'The Glazing Trick' Haakan Andersson says that pumping
  1076. >up the specular exponent makes the shiny spot smaller and not sharper. If
  1077. >I'm not mistaken, this is because he uses point light sources and not area
  1078. >light sources. If he uses area lights he will get correct results. I'm sure
  1079. >that Haakan knows this, but I got the impression that he felt that this was
  1080. >Phong's fault, and it really isn't...
  1081.  
  1082. You're right in that part of the problem is that he's using point lights.
  1083. However, Phong's highlights are basically a way to simulate surface shininess.
  1084. After all, a true point light would never reflect (well, except at one single
  1085. point) in a surface if the surface was perfectly reflective, with no "spread"
  1086. in the reflection.  Essentially, Phong's trick is to spread out the reflected
  1087. light in a cosine to a power distribution, and note the value of this
  1088. distribution from the eye's view angle - a wider distribution gives a duller
  1089. looking surface.  When you have area lights, you can't use this easily:  you
  1090. either have to reflect the lights directly (in which case the lights are seen
  1091. in the reflection as if the surface were perfectly reflective) or you have to
  1092. sample the area a sufficient amount to get the phong highlights and sum and
  1093. scale these.
  1094.  
  1095. In theory, what works for lights should work for light reflectors in the
  1096. environment.  In other words, you could sample the environment (i.e.  ray
  1097. trace) from the view of the surface and use Phong highlighting on these sample
  1098. rays and so get a shiny or dull looking surface.  If you're smart, you'll
  1099. simply use the Phong distribution itself to determine where the rays are shot,
  1100. shooting more rays in the higher contribution areas.  This has been done, and
  1101. looks pretty good with enough reflection samples.
  1102.  
  1103. The problem with Phong's trick is that it is not energy conserving at all:  a
  1104. low cosine power gives a lot more total energy (light) reflected from a
  1105. surface than a high cosine power.  Phong kept peak intensity constant, which
  1106. is important for making it easy for a user to adjust the specular highlight's
  1107. look, but is lousy from any physically based standpoint.
  1108.  
  1109. This lack of energy conservation hit home when I tried doing texture mapping of
  1110. the cosine exponent.  Say you texture this exponent and it varies from 0 to 10.
  1111. The weird effect is that the surface brightness is brightest around 1 (or less,
  1112. if you allow < 1 exponents) and drops off as you go to 10.  So at 0 you get
  1113. no specular highlight, at 1 the overall brightness is at its height, then it
  1114. drops off as you go to 10.
  1115.  
  1116.  
  1117. >The thresholding trick is a neat trick, that I didn't know about, and it'll
  1118. >save a lot of rendering time when you *do* use point light sources and still
  1119. >want a large shiny spot on your objects.
  1120.  
  1121. Yes - essentially, you're saying you want the surface to look perfectly
  1122. reflective (i.e. mirrorlike, not like brushed aluminum) and for the light to
  1123. have a finite radius.  The only problem I see is that the thresholding trick
  1124. does not take into account the distance the object is from the light, so that
  1125. the light will always be reflected as the same relative size no matter what
  1126. the distance the light is from the object.
  1127.  
  1128. ======== Net cullings follow ==================================================
  1129.  
  1130. Graphics Gems IV Announcement, by Paul Heckbert (ph@cs.cmu.edu)
  1131.  
  1132. We've decided to bring out Gems IV in 1994, not 1993, to keep the quality of
  1133. the series high.  The deadline for contributions is in the late Spring of
  1134. 1993.  Write to Academic Press (not me) for more detailed information about
  1135. how to contribute:
  1136.  
  1137.     Graphics Gems Editor
  1138.     Academic Press
  1139.     955 Massachusetts Ave
  1140.     Cambridge MA 02139
  1141.  
  1142. or email jswetland@igc.org .
  1143.  
  1144. And if you've got ideas for contributions and you'd like to discuss their
  1145. appropriateness with me, email me at ph@cs.cmu.edu .  Suggestions and
  1146. criticisms of the previous volumes are also welcome.
  1147.  
  1148. -------------------------------------------------------------------------------
  1149.  
  1150. Announcing the ACM SIGGRAPH Online Bibliography Project, by Stephen Spencer
  1151.     (biblio@siggraph.org)
  1152.  
  1153. A new resource for researchers is now available to the computer graphics
  1154. community.  Over 15,000 unique bibliographic references from the computer
  1155. graphics field have been compiled into a single database for use by students,
  1156. researchers, and the computer community in general.
  1157.  
  1158. The project started with the DEC online computer graphics bibliography, which
  1159. covered the years 1976 through 1986, and added the contributed bibliographic
  1160. databases of a number of individuals, expanding the years covered as well as
  1161. the sources of information.
  1162.  
  1163. This database includes references from conferences and workshops worldwide and
  1164. from a variety of publications, from magazines and journals to books dating
  1165. back as far as the late 19th century.  The majority of the major journals and
  1166. conference proceedings between the mid-1970's and 1992 are listed here.
  1167.  
  1168. The database is formatted in the BibTeX bibliography entry format, an
  1169. easy-to-read and understand ASCII format.  It is organized into files by year
  1170. (except for the entries prior to 1975, which are collected into one file by
  1171. themselves).
  1172.  
  1173. A set of tools for manipulating and searching the bibliography database is
  1174. also available for downloading.
  1175.  
  1176. The database is available for anonymous FTP from "siggraph.org"
  1177. "(128.248.245.250)" in the "publications/bibliography" directory.  Use
  1178. "anonymous" as the username and your electronic mail address as the password
  1179. to gain entry to the FTP area on this machine.  Please download and examine
  1180. the file "READ_ME" contained in the "publications/bibliography" directory for
  1181. more specific information concerning the database.
  1182.  
  1183. This project is an ongoing concern:  We plan to expand the bibliography, both
  1184. keeping it up-to-date as well as filling in missing pieces, large or small,
  1185. and polishing and refining the format of the existing database.  In addition,
  1186. plans to provide interactive online searching of the database are underway.
  1187. Alternative distribution channels are also being considered.
  1188.  
  1189. Volunteers are always welcome.  Contact "biblio@siggraph.org" for more
  1190. information on what needs to be done.
  1191.  
  1192. Questions, corrections, suggestions, and contributions of material to the
  1193. database can be directed to:  "biblio@siggraph.org" on the Internet.
  1194.  
  1195. -------------------------------------------------------------------------------
  1196.  
  1197. A Brief History of Blobby Modeling, by Paul Heckbert (ph@cs.cmu.edu)
  1198.  
  1199. [I deleted the reference - if you want these, check the online SIGGRAPH
  1200. bibliography (see elsewhere in this issue for details). - EAH]
  1201.  
  1202. People have known for a long time that if you have two implicit surfaces
  1203. f(x,y,z)=0 and g(x,y,z)=0 that are fairly continuous, with a common sign
  1204. convention (f and g positive on the inside, negative on the outside, say) then
  1205. the implicit surface defined by f+g=0 is a blend of the shapes.  See [Ricci
  1206. 1983] for a variant of this.
  1207.  
  1208. The van der Waals surfaces of molecules (roughly speaking, iso-potentials of
  1209. the electron density) are described in Chemistry and Physics books and [Max
  1210. 1983].  To create animation of DNA for Carl Sagan's COSMOS TV Series, Jim
  1211. Blinn proposed approximating each atom by a Gaussian potential, and using
  1212. superposition of these potentials to define a surface.  He ray traced these
  1213. [Blinn 1982], and called them "blobby models".
  1214.  
  1215. Shortly thereafter, people at Osaka University and at Toyo Links in Japan
  1216. began using blobby models also.  They called theirs "metaballs" (or, when
  1217. misspelled, "meatballs").  Yoichiro Kawaguchi became a big user of their
  1218. software and their Links parallel processor machine to create his "Growth"
  1219. animations which have appeared in the SIGGRAPH film show over the years.  The
  1220. graduate students implementing the metaball software under Koichi Omura at
  1221. Osaka used a piecewise quadratic approximation to the Gaussian, however, for
  1222. faster ray-surface intersection testing (no need for iterative root finders;
  1223. you just solve a quadratic).  I don't know of any papers by the Japanese on
  1224. their blobby modeling work, which is too bad, because they have probably
  1225. pushed the technique further than anyone.
  1226.  
  1227. Bloomenthal has discussed techniques for modeling organic forms (trees,
  1228. leaves, arms) using blobby techniques [Bloomenthal 1991] (though he prefers
  1229. the term "implicit modeling") and for polygonizing these using adaptive,
  1230. surface-tracking octrees [Bloomenthal 1988].  The latter algorithm is not
  1231. limited to blobby models, but works for any implicit model, not just blobs.
  1232. Polygonization allows fast z-buffer renderers to be used instead of ray
  1233. tracers, for interactive previewing of shapes.  A less general variant of this
  1234. algorithm was described in the "marching cubes" paper by [Lorensen 87] and
  1235. some bugs in this paper have been discussed in the scientific visualization
  1236. community in the years since.  In the sci-vis community, people call them
  1237. "iso-surfaces" not "implicit surfaces".
  1238.  
  1239. Meanwhile, in Canada and New Zealand, the Wyvill brothers, and grad students,
  1240. were doing investigating many of the same ideas:  approximations of Gaussians,
  1241. animation, and other ideas.  See their papers listed below.  Rather than
  1242. "blobbies" or "metaballs", they called their creations "soft objects".  But
  1243. it's really the same idea.
  1244.  
  1245. Bloomenthal and Wyvill collected many good papers on blobby and implicit
  1246. modeling for a recent SIGGRAPH tutorial (1991?).
  1247.  
  1248. -------------------------------------------------------------------------------
  1249.  
  1250. Cool Raytracing Ideas, Karen Paik (paik@cgl.citri.edu.au)
  1251.  
  1252. Karen comments on:
  1253. >    In general removing "common sense" restraints from rendering equations
  1254. >gives you flexibility to do a lot of ad hoc effects.
  1255.  
  1256. At Compugraphics 92, M. Beigbeder and V. Bourgin presented a paper titled
  1257. "New Perspectives for Image Synthesis" in which they used artistic perspective
  1258. projections, instead of the usual one. They had a "fishbone" perspective and a
  1259. circular perspective. These perspectives broke a lot of the fundamental
  1260. assumptions. Straight lines weren't always straight after they were projected
  1261. and light didn't always travel in a straight line.
  1262.  
  1263. -------------------------------------------------------------------------------
  1264.  
  1265. Optical Effects and Accuracy, by Sam Uselton (uselton@wk207.nas.nasa.gov)
  1266.  
  1267. In article <1992Nov12.133317.5833@genes.icgeb.trieste.it> oberto@genes.icgeb.trieste.it (Jacques Oberto) writes:
  1268. >I am trying to reproduce one of Newton's experiments with POV.
  1269. >Would a simulated white light beam hitting a glass prism with the
  1270. >right angle be scattered into a rainbow spectrum ?
  1271. >Are POV and other ray-tracers optically accurate in that respect ?
  1272. >Has anybody tested the properties of 'raytraced' light other than
  1273. >reflection and refraction ?
  1274.  
  1275. I don't know POV................BUT
  1276.  
  1277. If it is in the tradition of the standard ray tracers, it starts at the eye,
  1278. shooting rays through pixels into a scene.  Essentially this is tracing ray
  1279. paths in reverse.  Generally speaking, ray paths are reversible, so this is
  1280. fine.  There are, however, difficulties.  When a ray hits an object, in
  1281. addition to reflected and refracted rays, rays to the light sources must be
  1282. generated to determine shadows, intensity of illumination, etc.  If one of
  1283. these light source rays hits a refractive object, it may no longer be headed
  1284. for the light source once the refraction is done.
  1285.  
  1286. What one would LIKE to do is shoot the light source ray in a direction (there
  1287. may be several correct choices) which will result in a ray pointed at the
  1288. light AFTER the refraction.  Guessing what direction(s) this might be is HARD.
  1289. One solution is to shoot lots of illumination rays in various directions
  1290. (especially from a surface that is not perfectly specular, use the BRDF as the
  1291. distribution being randomly sampled => distribution ("distributed") ray
  1292. tracing).
  1293.  
  1294. Another solution is to do the ray tracing from the light, but then most of the
  1295. rays won't get to the screen so the effort is wasted.  There are various
  1296. schemes in the literature for getting around the difficulties, but my guess is
  1297. that they are not in most public domain code.
  1298.  
  1299. Another difficulty probably ignored in most PD code, is that in order to break
  1300. out the spectrum, the refraction angle must be calculated on a wavelength
  1301. dependent basis, generally with a single ray turning into several rays to
  1302. properly sample the spectrum.
  1303.  
  1304. We (Redner, Lee & Uselton ++)have done an image of the experiment I believe
  1305. you are describing.  It was accepted into the SIGGRAPH slide set and
  1306. distributed last summer at the conference.  It does involve a forward ray
  1307. tracing phase, and some stuff to remember these results in a way that can be
  1308. used in a traditional backward ray tracer.  Harder than it looks.
  1309.  
  1310. [Also see Mitchell & Hanrahan's article in SIGGRAPH '92 about this topic. -EAH]
  1311.  
  1312. -------------------------------------------------------------------------------
  1313.  
  1314. Map Projections Reference Book, by Mike Goss (goss@CS.ColoState.EDU)
  1315.  
  1316. One of the best reference books for map projections is
  1317.     Map Projections --- A Working Manual
  1318.     by John P. Snyder
  1319.     USGS Professional Paper 1395
  1320.     US Gov't Printing Office, 1987 (383 pages)
  1321.  
  1322. It's available directly from USGS, and was $20 a few years ago.  In the USA,
  1323. call 1-800-USA-MAPS (1-800-872-6277) for ordering info.  Snyder covers all the
  1324. projections used by USGS, and a few others.  For each one he gives a bit of
  1325. history, some explanatory material, detailed formulas, and examples.
  1326.  
  1327. There is also some source code available for anonymous FTP at
  1328. spectrum.xerox.com, under directory /pub/map/source (I haven't used it, but
  1329. I've seen it there).
  1330.  
  1331. -------------------------------------------------------------------------------
  1332.  
  1333. A Brief Review of Playmation, by Chris Williams
  1334.     (chrisw@fciad2.bsd.uchicago.edu)
  1335.  
  1336.    Playmation is a good quality ray-tracer, and one of the few that renders
  1337. patches (Catmull-rom).  The base package only renders at 256 colors, but an
  1338. they offer a 24-bit DOS-based renderer for ~$100.00.  It's a very nice
  1339. renderer, and renders with an 8-bit alpha channel.  The major nice points of
  1340. the package are its modeler and animation capabilities.  I may review this
  1341. entire package in the future.
  1342.  
  1343.    BTW, Will Vinton has had nothing to do with the software other than lending
  1344. it his name.  The program has been in development on the Amiga for several
  1345. years as Animation Apprentice, then as Animation Journeyman.  It's still
  1346. available on the Amiga, and Mac and SGI versions are supposed to be in the
  1347. works.
  1348.  
  1349. [and in a later post:]
  1350.  
  1351.     If you are familiar with patch-based modeling, it is a fairly powerful
  1352. modeling interface.  It (IMHO) gives Alias a run for the money at a tiny
  1353. fraction of the cost.  I consider it the "poor person's Alias."
  1354.  
  1355. -------------------------------------------------------------------------------
  1356.  
  1357. PV3D Quick Review, by David Anjo <david.anjo@canrem.com>
  1358.  
  1359. I promised one individual on the net's that once I had received my registered
  1360. copy of PV3D I would post a general, brief review of what I have found.
  1361.  
  1362. First and foremost the most current version of PV3D is v.0.50.  I did download
  1363. it from The Graphics Alternative BBS (510 524-2165/2780) before I received my
  1364. copy in the mail.  I do not have ftp status from the mail site I use, so I
  1365. cannot suggest a location for those so inclined.  I would suspect that You Can
  1366. Call Me Ray BBS (708 358-8721/5611) will have a copy available of v.0.50.  I
  1367. mention this because YCCMR is a free access board, while TGA is subscriber
  1368. based.  I highly recommend *both* systems for anyone interested in PC based
  1369. raytracing.
  1370.  
  1371. The features included within the shareware version are identical to those in
  1372. the registered version, save the following:
  1373.  
  1374. - you can save a created scene file for future manipulation.
  1375.  
  1376. - the registered version includes two additional utilities, of which one I
  1377. have found to be most handy (a screen capture to texture map facility - very
  1378. nice).  *Source* code is included for both.
  1379.  
  1380. - larger screen previews of the online texture maps included with the product.
  1381. The preview screens certainly help in picking an appropriate texture for that
  1382. object, especially when you forget what the 'ell GRNT9 is supposed to look
  1383. like =].  As per the point above there are simple instructions on how to
  1384. incorporate your "designed" textures to this online library.
  1385.  
  1386. - a host of sample "triangled" DXF files - something I certainly appreciate
  1387. given the sweat I've had creating them.  Their integration is seamless, BTW.
  1388.  
  1389. For those who do not know what PV3D is, here's a brief review.
  1390.  
  1391. PV3D is a wireframe modeler for those PC based raytracers using Persistence of
  1392. Vision.  It is something more oriented towards the novice PoV user and for
  1393. even the advanced, experienced souls, who just want to get on with creating
  1394. (hopefully) interesting raytraced artworks.  Beyond providing the basic
  1395. primitives (sphere, quad sphere, cylinders, cones, cubes, pyramids, positive
  1396. and negative blobs, planes and torii) PV3D can also generate spline based
  1397. objects.  You can incorporate "triangled" DXF files.  Multiple lights can be
  1398. positioned, as well as the look_at and camera locations, very easily.  You can
  1399. preview the textures used and the colours applied (corresponding surface
  1400. "highlights") to individual objects.  It is reasonably priced (250 Frebch
  1401. Francs) and although still in a beta stage, extremely promising.  It has cut
  1402. down my "code" time dramatically, increasing my creative time ten fold.  I'm a
  1403. computer based artist and the goal is to produce art - PV3D is a major benefit
  1404. in that pursuit.
  1405.  
  1406. Back to the latest version...
  1407.  
  1408. The biggest change in v.0.50 as far as I'm concerned is the new View 3D
  1409. option.  This will give you a world view of your scene from the perspective of
  1410. the camera location.  This is a major advantage, especially when you get up
  1411. close to the maximum of 150 objects and you are, quite simply, lost.  I know,
  1412. I certainly have been in the past =].  Very nice addition.
  1413.  
  1414. The documentation is still hurting from a lack of a suitable French to English
  1415. translation, but I intend to offer my assistance in that regard.  Mind you if
  1416. the author's English is bad, my French is a lot worse.  I will be seeking a
  1417. good translation program in this effort - any suggestions for a bi-directional
  1418. program would be much appreciated.
  1419.  
  1420. [unfortunately, I didn't receive the second part of the review at our site,
  1421. so this is all there is! - EAH]
  1422.  
  1423. -------------------------------------------------------------------------------
  1424.  
  1425. Bounding Volumes (Sphere vs. Box), by Tom Wilson (wilson@cs.ucf.edu)
  1426.  
  1427. [For those learning about the value of bounding volumes, here's a summary.
  1428. - EAH]
  1429.  
  1430. djb@geovision.gvc.com (Darren Burns) wrote:
  1431. >I had been under the impression that it was quicker to intersect
  1432. >a line with a sphere than with a box.  I just did a timing test.
  1433. >Basically I had a bunch of spheres or boxes sitting there and I
  1434. >ray-traced the scene, once using spheres and once using boxes.
  1435. >I found that the boxes were faster (not a lot, 11 seconds for
  1436. >spheres vs 9 for boxes).  The volumes were about the same for
  1437. >both types of objects; actually the spheres were a little smaller.
  1438.  
  1439. You must be careful when drawing your conclusion.  I've found 3D boxes faster
  1440. too, but it is very dependent upon what's inside as to whether or not it will
  1441. be.  Depending on how optimized your code is, the sphere BV may be faster to
  1442. intersect with a ray, but the comparison doesn't end there.  When a ray hits
  1443. an object inside the BV, both the sphere and the box are a waste of time.
  1444. When the object inside the BV is missed, it is up to the BV to cull as many
  1445. rays as possible.  You want to perform the ray-object intersection code as few
  1446. times as possible when it will miss the object (you obviously must execute the
  1447. code when there is a hit).
  1448.  
  1449. Also you must take into account the relative execution times of (1) ray-sphere
  1450. (as BV) int., (2) ray-box int., and (3) ray-object int.  If (3) is much
  1451. greater than both (1) and (2), you may get a better answer from your test.
  1452. Suppose you have 2 BVs:  BV #1 is the slower of the two, but culls more
  1453. misses, BV #2 is the faster of the two, but culls fewer misses.  Which is
  1454. better?  That depends on how many rays are actually involved in the
  1455. comparison, but let's be sloppy and just say:  if the time saved by using the
  1456. faster BV #2 is lost by executing the slower ray-object routine more times, BV
  1457. #1 may actually be the better choice.  Too many tests involve spheres or boxes
  1458. around simple triangles.
  1459.  
  1460. Basically, you are introducing yourself to an old, but difficult-to-fully-
  1461. -solve problem.  Much work has been done on the choice of BVs.  Couple that
  1462. with a construction of a hierarchy of BVs and you really have a mess.  Find
  1463. some of the bibliographies at ftp sites to see the work that has already been
  1464. done (also you might find my collection of ray tracing abstracts which might
  1465. give you a clue about what is discussed before you actively seek the papers --
  1466. send me e-mail for more details if you'd like, I don't want to bother at the
  1467. moment).  The text _An Introduction to Ray Tracing_ has a sufficient
  1468. explanation of the background material.
  1469.  
  1470. The only strong conclusion I can make is that boxes work best for the scene(s)
  1471. you tested.  They may be a good choice in general, but that's a dangerous
  1472. statement.
  1473.  
  1474. I hope I made some helpful comments. Others are appreciated.
  1475.  
  1476. [Me, I've given up bounding volume spheres and even ellipsoids:  boxes seem to
  1477. almost always have tighter bounds and having only one bounding volume
  1478. throughout your program saves a lot of messing around in the code.  - EAH]
  1479.  
  1480. -------------------------------------------------------------------------------
  1481.  
  1482. Raytracing Swept Objects, by Mark Podlipec (podlipec@dgxyris.webo.dg.com)
  1483.  
  1484. In article <BAGCHI.92Sep22220950@quip.eecs.umich.edu>, bagchi@eecs.umich.edu (Ranjan Drzzzzt!  Bagchi) writes:
  1485. |>
  1486. |>     Consider this object:  I take a curve between two endpoints, and rotate
  1487. |> it 360 degrees about the y axis.  How would I go about ray-tracing the solid
  1488. |> I've just swept out.
  1489. |>
  1490. |>     I've given this some thought.. and I'm fairly sure that in
  1491. |> the general case, this is quite difficult.  But are there any classes
  1492. |> of curves which sweep out solids which are easy to get
  1493. |> ray-intersections and surface normals?
  1494.  
  1495. I've implemented an object for rayshade a couple of years ago which is pretty
  1496. similar to what you've described(I call it cubicspin).  You take any curve
  1497. described by a 3rd degree polynomial and rotate it about an arbitrary axis.
  1498. End points are also specified.
  1499.  
  1500. A third degree polynomial rotated like that becomes a 6th degree polynomial
  1501. and then you can substitute in the ray equations to find the point of
  1502. intersection.  Throw in some checking for the end points and there ya go.
  1503. This is the brute force method.
  1504.  
  1505. I use natural cubic splines to specify the curve.
  1506.  
  1507. Now if you started with a 4th degree curve, you would have to solve 8th degree
  1508. equations, etc.  But for the most uses, the extra degrees don't buy you much.
  1509.  
  1510. [My favorite article on this topic is still:
  1511.     %A Jarke J. van Wijk
  1512.     %T Ray Tracing Objects Defined by Sweeping Planar Cubic Splines
  1513.     %J ACM Trans. on Graphics
  1514.     %V 3
  1515.     %N 3
  1516.     %D July 1984
  1517.     %P 223-37
  1518. - EAH]
  1519.  
  1520. -------------------------------------------------------------------------------
  1521.  
  1522. Ray Transformation, by Kendall Bennett (rcskb@minyos.xx.rmit.oz.au)
  1523.  
  1524. [an article for people trying to implement the viewing transform. - EAH]
  1525.  
  1526. >belme@waterloo.hp.com (Frank Belme) writes:
  1527. >
  1528. >I was wondering what a good way is to calculate the direction of each ray
  1529. >for ray tracing a scene given an eyepoint, eye direction, and field of view
  1530. >angle.  Any help would be appreciated.  Thanks.
  1531.  
  1532. There is actually a better way of doing this, that can take into account
  1533. aspect ratio and fields of view prior to actually computing the ray direction
  1534. (the speedup in this routine are generally not that noticeable, but it is nice
  1535. to have something elegant!).
  1536.  
  1537. The first step is to compute two vectors, one in the direction of increasing x
  1538. coordinates for the image, and one for increasing y coords, that are scaled to
  1539. be the length of a pixel in each respective direction (aspect ratio calcs go
  1540. in here).  Then compute a vector that points towards the upper left corner of
  1541. the screen (I will give pseudo code later).
  1542.  
  1543. When you have this information, you can quickly create any ray to fire by
  1544. simply adding appropriately scaled versions of the x and y direction vectors
  1545. to the vector pointing to the first pixel (of course you want to normalise the
  1546. final vector :-):
  1547.  
  1548. PreProcessing stage:
  1549.  
  1550.     xdir = (2 * lookDistance * tan(hfov / 2)) / xres
  1551.     ydir = (2 * lookDistance * tan(vfov / 2)) / yres
  1552.  
  1553.     ydir *= aspect // Adjust y pixel size given aspect ratio
  1554.  
  1555.     LLdir = camera.dir - (xdir * xres)/2 - (ydir * yres)/2
  1556.  
  1557. Computing the ray to fire:
  1558.  
  1559.     dir = LLdir + xdir * x + ydir * y
  1560.     dir = dir normalised
  1561.  
  1562. and you are done - not rotations, just simply vector additions and scales
  1563. (this is almost directly taken from my C++ ray tracer).
  1564.  
  1565. -------------------------------------------------------------------------------
  1566. END OF RTNEWS
  1567.