POV-Ray : Newsgroups : povray.newusers : shape generation (functions and more) : Re: shape generation (functions and more) Server Time
30 Jul 2024 14:17:01 EDT (-0400)
  Re: shape generation (functions and more)  
From: Hughes, B 
Date: 17 Feb 2004 16:15:38
Message: <4032847a$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:40325137@news.povray.org...
> "lars petter" <lar### [at] higno> wrote in message
> news:4030e7fc$1@news.povray.org...
>
> > Quartic parabola - a 4th degree polynomial (has two bumps at the bottom)
> > that has been swept around the z axis. The equation is:
> > 0.1 x^4 - x^2 - y^2 - z^2 + 0.9 = 0
> >
> > how do i use this?
>
> No idea - but this is weird looking if nothing else.... (I've put the abs
bit in
> since you specified =0 rather than <=0 )
>
> #declare fn_Xb = function(x,y,z){0.1*pow(x,4) - x*x - y*y - z*z + 0.9}
>
> isosurface {
>   function { abs(fn_Xb(x, y, z)) - 0.1}
>   contained_by { box {-10,10 } }
>   accuracy 0.001
>   max_gradient 250  // Eeeek!!!
>   all_intersections
>   pigment{Red}
> }

Hey, what's with that huge container Tom?? I managed to get a much faster
render by lowering it to a -1,1 size! Heh-heh. Curious shape, I don't know
what it is either mainly because I don't know how much of it is visible.

I figured a way to get just a surface sheet. Maybe compatible with Mike
Williams' iso-thickener? Probably not, I haven't checked. I should have
realized this before, but these function things will always be new to me. I
took Tom's iso and simply removed the y parameter from the function itself.
Here is a whole scene showing it in action, with a tiny difference in the
equation. And although I had used pow(x,4) before, too, I was unsure about
it causing any changes the original equation. I still don't know why I was
subtracting it from zero in the isosurface in my other reply! Something I
picked up from other people, I think.  :-D

global_settings {
  assumed_gamma 1.0
  photons {
   spacing 0.02
  }
}

camera {
  location  <1, 2, -3>
  look_at   <0, -0.25, 0>
}

light_source {
 -100*z,
 1
  rotate <10, 0, 0> // move above y plane
  photons {reflection on}
}

plane {
 y,0
 pigment {color rgb 1}
 finish {diffuse 1}
photons {
 collect on
}
}

#declare fn_Xb = function (x,z){0.5*pow(x,4) - x*x - y*y - z*z + 0.9}

isosurface {
  function { (fn_Xb(x,z))-0.1}
  contained_by { box {<-1,0,-1>,<1,0.5,0>} } // get half z, quarter y
  accuracy 0.001
  max_gradient 2
  all_intersections
  open
  pigment{color rgb 0}
  finish {reflection {0.99}}
  photons {target 1 reflection on collect on}
}


This could be considered the blind leading the blind, eh?

-- 
Bob H.
http://www.3digitaleyes.com


Post a reply to this message

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