POV-Ray : Newsgroups : povray.general : 3d functions : Re: 3d functions Server Time
9 Aug 2024 21:13:46 EDT (-0400)
  Re: 3d functions  
From: Tom Melly
Date: 15 May 2000 04:58:29
Message: <391fbc35$1@news.povray.org>
"Pabs" <pab### [at] hotmailcom> wrote in message
news:391F661A.190894C5@hotmail.com...
>
> If you want to render those functions you might try the parametric
surfaces
> available in MegaPOV
> -something like
> parametric{
> function u ,  v, u^2+ v^2
> 0 , 1
> -1,1
> }
>

Sounds good and thanks for the help everyone - I was playing with using
formulas to generate the y value for a bicubic_patch -

for example

#macro ReturnY(nNum, rNum)
  #local nTemp1 = (nNum/200)+1;
  #local rTemp1 = (rNum/200)+0;
  #local loopCount = 0;
  #while (loopCount < 5)
    #local nTemp2 = 2*(nTemp1 * rTemp1);
    #local rTemp2 = (rTemp1 * rTemp1) - (nTemp1 * nTemp1);
    #if (rTemp2 > 1)
      #local rTemp2 = rTemp2 - 0.5;
    #end
    #local nTemp1 = nTemp2;
    #local rTemp1 = rTemp2;
    #local loopCount = loopCount + 1;
  #end
  #declare yResult = rTemp1 * 10; // this is the final result
#end

#macro MakePatch(xOffset, zOffset, wavePigment)
  object {
    bicubic_patch { type 1 flatness 0.01 u_steps 3 v_steps 3,
      #local zPos = 0;
      #while (zPos < 4)
        #local xPos=0;
        #while (xPos<4)
          ReturnY(zPos+zOffset, xPos+xOffset)
//          #debug concat("Y Value is:",str(yResult,5,25),"\n")
          <xPos+xOffset, yResult, zPos+zOffset>
          #local xPos = xPos + 1;
        #end
        #local zPos = zPos + 1;
      #end
      pigment{wavePigment}
      finish{ambient 0.5}
    }
  }
#end


Post a reply to this message

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