POV-Ray : Newsgroups : povray.general : how to make an ellipsoid at exact place? Server Time
31 Jul 2024 22:16:29 EDT (-0400)
  how to make an ellipsoid at exact place? (Message 1 to 4 of 4)  
From: yoon
Subject: how to make an ellipsoid at exact place?
Date: 20 Aug 2006 11:35:19
Message: <44e88137@news.povray.org>
I tried to make two ellipsoids at the opposite corner of a cube.

box { <3,3,3>,<-3,-3,-3>,
    pigment { color Red }
}
sphere { <3,3,3>,1
    pigment { color Blue }
    scale <2,0,0>
}
sphere { <-3,-3,-3>,1
    pigment { color Blue }
    scale <2,0,0>
}

"scale" stretchs the sphere twice longer along the x-axis.

but the center coordinate of ellipsoid is stretched as well.

They should at the <3,3,3> and <-3,-3,-3> but they are at <6,3,3> and 
<-6,-3,-3>

How can I make ellipsoid at the exact place?

Cheers

JH


Post a reply to this message

From: Marc
Subject: Re: how to make an ellipsoid at exact place?
Date: 20 Aug 2006 12:01:34
Message: <44e8875e$1@news.povray.org>

44e88137@news.povray.org...
> "scale" stretchs the sphere twice longer along the x-axis.
>
> but the center coordinate of ellipsoid is stretched as well.
>
> They should at the <3,3,3> and <-3,-3,-3> but they are at <6,3,3> and
> <-6,-3,-3>
>
> How can I make ellipsoid at the exact place?
>
> Cheers
>
> JH
>
>

If you create your spheres a <0,0,0> , stretch them , THEN translate them at
<3,3,3> and <-3,-3,-3>, they'll be where you want


Marc


Post a reply to this message

From: Roman Reiner
Subject: Re: how to make an ellipsoid at exact place?
Date: 20 Aug 2006 12:10:00
Message: <web.44e888224a0349d4b48318060@news.povray.org>
In POVRay all transformations (translating, scaling and rotating) are in
relation to the origin. So scaling an object which isn't located at the
origin will also scale its position. An object not located at the origin
will 'orbit' around the coordinate axes when being rotated.
Hence: Create the objects at the center, scale/rotate there and translate
afterwards.

Also it should be scale <2,1,1> instead of <2,0,0>. POVRay should print out
a warning message about that issue.

box { <3,3,3>,<-3,-3,-3>,
    pigment { color Red }
}
sphere { <0,0,0>,1
    pigment { color Blue }
    scale <2,1,1>
    translate <3,3,3>
}
sphere { <0,0,0>,1
    pigment { color Blue }
    scale <2,1,1>
    translate <-3,-3,-3>
}

or somewhat shorter:

box { -3, 3
    pigment { color Red }
}
sphere { 0,1
    pigment { color Blue }
    scale 2*x
    translate 3
}
sphere { 0,1
    pigment { color Blue }
    scale 2*x
    translate -3
}

Hope this helps

Regards Roman


Post a reply to this message

From: Tim Attwood
Subject: Re: how to make an ellipsoid at exact place?
Date: 20 Aug 2006 20:04:15
Message: <44e8f87f@news.povray.org>
Mathematically, if you scale-down a sphere in y
to become an ellipsoid, the foci along the x-axis become
+- MR*e*sqrt(-e/(e*e-1))
where e is the eccentricity (scale amount), and
where MR is the major radius.


Post a reply to this message

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