POV-Ray : Newsgroups : povray.binaries.images : Bug in my code or in trace function? (~60kb) : Bug in my code or in trace function? (~60kb) Server Time
13 Aug 2024 03:23:20 EDT (-0400)
  Bug in my code or in trace function? (~60kb)  
From: Xilo Musimene
Date: 10 May 2003 16:10:54
Message: <3EBD5CCC.9030902@hotpop.com>
Hi,
   You might want to read my question on povray.advanced-users 
concerning my trace scanning script.

The first image is the trace scan of a sphere { 0, 1}.
The second on is the trace scane of a torus { 0.7, 0.3 rotate x*90 }

Images were parsed by povray with my trace scan script, and were 
rendered by a home made OpenGL application.

The bug is that the sphere and the torus are strangely scaled; normally 
you should get a bunch of circles made of the dots, now you get an egg 
shape...

Where does the egg shape comes from??

Here is my TraceRay function; for a given XZ point it gets all the Y 
values were it hits a surface of my object.

#declare StartRay = <X,2,Y>;
#declare SurfaceTouch = StartRay;
#while(StartRay.y > -1)
   #declare SurfaceTouch = trace(MyObject, StartRay, <X, -2, Y>);

   #if(SurfaceTouch.x != 0 | SurfaceTouch.y != 0 | SurfaceTouch.z != 0)
     #write(myFile str(SurfaceTouch.y, 0,3), " ")
   #else
     #declare SurfaceTouch = <0,-2,0>;
   #end

   #declare StartRay = SurfaceTouch;
#end

Thanks a lot for any help!
   Xilo

-- 
Dedicated to audio/visual and interactive artwork.
Author of The Primary Colors of CSound:
http://www.geocities.com/simonlemieux/PCCS/index.html


Post a reply to this message


Attachments:
Download 'sphere-gl.jpg' (31 KB) Download 'torus-gl.jpg' (23 KB)

Preview of image 'sphere-gl.jpg'
sphere-gl.jpg

Preview of image 'torus-gl.jpg'
torus-gl.jpg


 

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