|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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?
Simen.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <38d90a6e$1@news.povray.org>, "Simen Kvaal"
<sim### [at] studentmatnatuiono> 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?
Usually, this will work:
#declare groundHeight = 0; // distance along y-axis of ground
#declare MyObj =
...object declaration...
object {MyObj
translate y*(groundHeight-min_extent(MyObj).y)
}
However, with some objects(like blobs), it is imprecise. The min_extent
function returns the lower left front(-x,-y,-z) corner of the bounding
box of the object, and the bounding box is not always exactly
calculated(it would be too difficult to calculate for some objects). It
should work fine for isosurfaces, though.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <chrishuff_99-890CEE.15344922032000@news.povray.org>, Chris
Huff <chr### [at] yahoocom> wrote:
> It should work fine for isosurfaces, though.
Oops!
Actually, it sometimes won't. It should work fine, as long as the
isosurface contacts the lower part of the contained_by object.(or is
close enough the gap doesn't matter)
--
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Simen Kvaal <sim### [at] studentmatnatuiono> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 22 Mar 2000 19:01:13 +0100, "Simen Kvaal"
<sim### [at] studentmatnatuiono> 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] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 24 Mar 2000 12:49:27 +0100, "Simen Kvaal"
<sim### [at] studentmatnatuiono> 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] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|