|
![](/i/fill.gif) |
Ben Chambers wrote:
>
> Hmm... neat, but I can't seem to make it work...
> Ok, I have here an object:
>
> sphere {
> 0,1
> scale <5,1,5>
> }
>
> I also have three points on a plane (lets call them
> p1,p2,p3). I'd like to have this flattened sphere
> oriented on the plane... Maybe I'm just braindead
> tonight, but the reorient macro didn't do it for
> me...
>
If the plane is described by 3 points, you first need the normal vector
of the plane:
Normal=vnormalize(vcross(p2-p1,p3-p1))
and the distance along that normal:
Distance=vdot(p1,Normal)
Now to align your flattened sphere with the plane, using the Reorient
macro:
sphere{
0,1
scale <5,1,5>
Reorient(y,Normal)
translate Normal*Distance
}
This is untested, but as far as I can see, should work.
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
![](/i/fill.gif) |