[comp.graphics] BugFix to Cones in MTV Raytracer...

markv@phoenix.Princeton.EDU (Mark T Vandewettering) (08/27/89)

As was recently pointed out to me by Mike Schoenborn, the cylinder code
in the version of the MTV raytracer is broken somewhat severely.  Or at
least it appeared to be so, what actually happens is that I forgot 
to normalize two vectors, which leads to interesting distortions and 
wierd looking cylinders.  Anyway, the bug is in cone.c, in the function
MakeCone().  After the vectors cd -> cone_u and cd -> cone_v are
created, they should be normalized.  A context diff follows at the end
of this.
  This bugfix will be worked into the next release, and I should also
update the version on cs.uoregon.edu SOMETIME REAL SOON NOW (read, don't
hold your breath TOO anxiously).   Hope that this program continues to
be of use... :-)

Mark


*** ../tmp/cone.c	Fri Aug 25 20:25:52 1989
--- cone.c	Fri Aug 25 21:31:04 1989
***************
*** 240,247 ****
--- 240,251 ----
  	/* find two axes which are at right angles to cone_w
  	 */
  
+ 
  	VecCross(cd -> cone_w, tmp, cd -> cone_u) ;
  	VecCross(cd -> cone_u, cd -> cone_w, cd -> cone_v) ;
+ 
+ 	VecNormalize(cd -> cone_u) ;
+ 	VecNormalize(cd -> cone_v) ;
  
  	cd -> cone_min_d = VecDot(cd -> cone_w, cd -> cone_base) ;
  	cd -> cone_max_d = VecDot(cd -> cone_w, cd -> cone_apex) ;