|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|