![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Simen Kvaal <sim### [at] student matnat uio no> wrote:
: Given an object (for example an arbitrary isosurface). Is it any way to
: calculate, using for example trace, the lower y-coordinate, for example, so
: that I can place it as close as possible to the ground?
If it's an isosurface defined with a function, then you can calculate
the lowest point using mathematics.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> If it's an isosurface defined with a function, then you can calculate
>the lowest point using mathematics.
This is not true. Many functions have no algebraic solutions. (Above 5th
order polynomials it's impossible!)
The surface in question is: x^4 + y ^4 + z^4 - (x^2 + y^2 + z^2) -1 = 0.
This is a fouth order plynomial, and is not easily solved using algebra.. A
numerical methos would be better...
Simen.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 22 Mar 2000 19:01:13 +0100, "Simen Kvaal"
<sim### [at] student matnat uio no> wrote:
>Given an object (for example an arbitrary isosurface). Is it any way to
>calculate, using for example trace, the lower y-coordinate, for example, so
>that I can place it as close as possible to the ground?
#macro Place_On_Earth ( Object, Steps ) // y is up :)
#local Min = min_extent ( Object );
#local Max = max_extent ( Object );
#local Increment = ( Max - Min ) / Steps;
#local X = Min.x; #local Continue=1; #local Y = Min.y;
#while ( (Y < Max.y) & Continue )
#while ( (X < Max.x) & Continue )
#local Trace = trace ( Object, <X,Y,Min.z>, z, Normal );
#if ( vlength (Normal)) #local Continue = 0; #end
#local X = X + Increment.x;
#end
#local Y = Y + Increment.y;
#end
object { Object translate -y * ( Y - Increment.y ) }
#end
It *might* just work a prima vista but I doubt it as I typed it
directly in the newsreader ;) Anyway, you get the idea.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
If I remember right, you can calculate minimums and maximums by deriving
the function twice. So there wouldn't be any problem.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
But we are not talking about finding maxima and minima of real-valued
functions, because the general funciotn-surface is a level surface of a
function of three variables. So, deriving a sphere function, x*x+y*y+z*z-1,
gives you a 3-vector (gradient): grad f = <2x. 2y, 2x>. Solving this for
zero as you would with normal functions yields <0, 0, 0>, which means that
the function has a extreme point at <0, 0, 0> In fact, it's a minimum, but
this is at the centre of the sphere, which is _not_ the lowes point on the
sphere. (Of course not, I'd say.) This minimum represents the 'density' of a
4-d-object, and the sphere itself is the set of all denisties with a
specific value, for example r^2.
It would be lesser problems if one were able to solve the function for for
example y by saying:
x*x+y*y+z*z=1 => y = +-sqrt(1-x*x-z*z) and this function we can derive and
find maxima and minima of. BUT NOT from for example: sin x - x = 0, which
have noe algebraic solutions!
Warp skrev i meldingen <38db2db8@news.povray.org>...
> If I remember right, you can calculate minimums and maximums by deriving
>the function twice. So there wouldn't be any problem.
>
>--
>main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
>):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thanks! :D Works with isos too? (Haven't got the time to test it right now!)
Simen.
>#macro Place_On_Earth ( Object, Steps ) // y is up :)
>#end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 24 Mar 2000 12:49:27 +0100, "Simen Kvaal"
<sim### [at] student matnat uio no> wrote:
>Thanks! :D Works with isos too? (Haven't got the time to test it right now!)
>
>Simen.
You mean it ran the first time?!?!
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Well, I didn't actually try it; I just assumed you knew what you ere doing.
(heh..) But I've tried it now, but
it doesn't seem to work. I noted that the Normal-vector had to be
initialized first, so I did that, and then I got
no errors. But a simple sphere of radius 1 floating 30 units above a
(checkered) plane, did not show up.
I really only need a way to place an object on a _given_ y-level, and thanks
to you, I think I know how now.
Simen.
Peter Popov skrev i meldingen ...
>On Fri, 24 Mar 2000 12:49:27 +0100, "Simen Kvaal"
><sim### [at] student matnat uio no> wrote:
>
>>Thanks! :D Works with isos too? (Haven't got the time to test it right
now!)
>>
>>Simen.
>
>You mean it ran the first time?!?!
>
>
>Peter Popov ICQ : 15002700
>Personal e-mail : pet### [at] usa net
>TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <XabaOGJ2TFw0Mrf=rUXtavRUQB6F@4ax.com>, Peter Popov
<pet### [at] usa net> wrote:
...
> It *might* just work a prima vista but I doubt it as I typed it
> directly in the newsreader ;) Anyway, you get the idea.
This version seems to work fine, although I haven't heavily tested it
yet. It returns the lowest point instead of positioning the object on a
surface at y=0.
#macro FindLowestPoint(Object, Steps)
#local MinExt = min_extent(Object);
#local MaxExt = max_extent(Object);
#local Size = MaxExt-MinExt;
#local LowestPt = MaxExt;
#local Z=0;
#while(Z<Steps)
#local X=0;
#while(X<Steps)
#local TempPt = trace(Object,
MinExt+(<X,0,Z>*Size/(Steps-1))-y, y);
#if((TempPt.y<LowestPt.y)&((TempPt.x!=0)|(TempPt.y!=0)|(TempPt.z!=0)))
#local LowestPt = TempPt;
#end
#local X=X+1;
#end
#local Z=Z+1;
#end
(LowestPt)
#end
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thank you! I will test it as soon as I can! It would be great if it worked.
It's so difficult sometimes to place an arbitrari isosurface on the 'ground'
when I want to...
Simen.
>This version seems to work fine, although I haven't heavily tested it
>yet. It returns the lowest point instead of positioning the object on a
>surface at y=0.
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |