POV-Ray : Newsgroups : povray.unofficial.patches : Help with normal returned by trace() Server Time
1 Sep 2024 18:13:30 EDT (-0400)
  Help with normal returned by trace() (Message 1 to 6 of 6)  
From: Rich
Subject: Help with normal returned by trace()
Date: 7 Feb 2001 16:48:08
Message: <Xns904196F2795B7spammindspringcom@204.213.191.228>
I'm trying to apply shapes to the surface of an object to make the object 
look larger...  Anyway, I'm using the trace function to find the 
intersection and normal, but the normal is expressed in 0..1 format instead 
of the 0-360 format needed for rotations.  I've tried multiplying the 
returned normal with 360, and I tried seperate rotates for each part of the 
normal multiplied by 360, but the shape isn't rotated the way I'm expecting 
it to.  I am expecting the flattened boxes to lie flat against the sphere.  
I need to be able to rotate the object, as I will eventually be using 
fairly complex shapes in place of the box.  Any help appreciated, sample 
code is below.

Rich

-------------------------------------
#version unofficial MegaPov 0.7;     

camera {
  location  <5.0, 5.0, -15.0>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}

light_source {<-300,100,-200> color rgb 2}
light_source {<300,100,200> color rgb <0,0,.8>}       

#declare MySphere = sphere {<0, 0, 0>, 4} 
#declare Norm = <0, 0, 0>; 

#declare R1 = seed(0);

#declare lp = 0;
#while (lp < 500)
  #declare Start = <(rand(R1) -.5)*10,
                    (rand(R1) -.5)*10,
                    (rand(R1) -.5)*10>;
  #declare Inter=trace(MySphere, Start, <0, 0, 0>-Start, Norm); 

  box { 
    <-.2,0,-.2> <.2,.1,.2> 
    //rotate Norm*360
    rotate Norm.x*360
    rotate Norm.y*360
    rotate Norm.z*360
    translate Inter
    texture {pigment {color red 1}} 
  }

  #declare lp = lp + 1;
#end 

object {
  MySphere 
  texture {pigment {rgb 1}} 
}


-- 
Rich Allen
(Remove SPAM from my address to reply by e-mail)


Post a reply to this message

From: Ron Parker
Subject: Re: Help with normal returned by trace()
Date: 7 Feb 2001 16:51:36
Message: <slrn983gri.5lm.ron.parker@fwi.com>
On 7 Feb 2001 16:48:08 -0500, Rich wrote:
>  I'm trying to apply shapes to the surface of an object to make the object 
>look larger...  Anyway, I'm using the trace function to find the 
>intersection and normal, but the normal is expressed in 0..1 format instead 
>of the 0-360 format needed for rotations.  I've tried multiplying the 
>returned normal with 360, and I tried seperate rotates for each part of the 
>normal multiplied by 360, but the shape isn't rotated the way I'm expecting 
>it to.  I am expecting the flattened boxes to lie flat against the sphere.  
>I need to be able to rotate the object, as I will eventually be using 
>fairly complex shapes in place of the box.  Any help appreciated, sample 
>code is below.

The normal is nothing like a rotation vector.  You need John VanSickle's
Reorient macro, but of course I've forgotten the URL.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ken
Subject: Re: Help with normal returned by trace()
Date: 7 Feb 2001 16:53:35
Message: <3A81C489.A19DA76F@pacbell.net>
Ron Parker wrote:

> The normal is nothing like a rotation vector.  You need John VanSickle's
> Reorient macro, but of course I've forgotten the URL.

http://users4.50megs.com/enphilistor/index.htm

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ron Parker
Subject: Re: Help with normal returned by trace()
Date: 7 Feb 2001 16:56:18
Message: <slrn983h4c.5lm.ron.parker@fwi.com>
On Wed, 07 Feb 2001 13:56:25 -0800, Ken wrote:
>Date: Wed, 07 Feb 2001 13:56:25 -0800
>X-Trace: 7 Feb 2001 16:53:35 -0500, 64.165.148.49

That was fast, but it would have looked faster if you'd fixed your clock.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ken
Subject: Re: Help with normal returned by trace()
Date: 7 Feb 2001 16:58:08
Message: <3A81C4D8.E7D9C547@pacbell.net>
Ron Parker wrote:
> 
> On Wed, 07 Feb 2001 13:56:25 -0800, Ken wrote:
> >Date: Wed, 07 Feb 2001 13:56:25 -0800
> >X-Trace: 7 Feb 2001 16:53:35 -0500, 64.165.148.49
> 
> That was fast, but it would have looked faster if you'd fixed your clock.

I'll see what I can do. :)

-- 
Ken Tyler


Post a reply to this message

From: Rich
Subject: Re: Help with normal returned by trace()
Date: 7 Feb 2001 17:17:09
Message: <Xns90419BDDD6498spammindspringcom@204.213.191.228>
Ken <tyl### [at] pacbellnet> wrote in <3A81C4D8.E7D9C547@pacbell.net>:

  Thanks for the quick response guys!

-- 
Rich Allen
(Remove SPAM from my address to reply by e-mail)


Post a reply to this message

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