POV-Ray : Newsgroups : povray.text.scene-files : Bicubic Patch Macro (Macro Code) : Re: Bicubic Patch Macro (Macro Code) Server Time
3 Jul 2024 01:25:00 EDT (-0400)
  Re: Bicubic Patch Macro (Macro Code)  
From: Nekar Xenos
Date: 8 Feb 2002 02:49:21
Message: <3c638301@news.povray.org>
Find "file://"
Replace with "//  "

:P

--
#local X=20*<-2,2,5>;#local K=2*z*X-X;#local R=seed(frame_number);blob{#while(K
.x>X.x)#local N=X+<rand(R)rand(R)1>/3;#local X=(vlength(N-K)<vlength(X-K)?N:2*X
-N);sphere{X,1,1rotate z*90}sphere{X,1,1}#end pigment{rgbt 1}interior{media{
emission<2,4,5>*5}}hollow scale.05}//   http://nekar_xenos.tripod.com/metanoia/
sphere_sweep{catmull_rom_spline 6<-8,-8>1<-8,-8>1<-8,8>1<8,-8>1<8,8>1<8,8>1
translate 20*z pigment{gradient z scale 3color_map{[0rgb<0,9,18>][1rgb 0]}}}
"Dave Dunn" <poi### [at] aolcom> wrote in message
news:3C63056A.1D933065@aol.com...
> /*Here is a macro that emulates a wireframe modeler for a single bicubic
> patch. This file is only the macro and should be saved as "patcher.mcr"
> in order for the next scene file to render. The demo will be of a flat
> sixteen point patch. changing the control points in the array will allow
> you to model the bicubic patch interactively. This may come in handy for
> anyone wanting to do a leaf, a flower petal, or a sheet of paper.  */
>
> file://Square Patch Array DO NOT DELETE! Copy to Scene.
> #declare Points = array [16]
> {
> file://Bottom Row
> <-7.5,-7.5,0>, file://0-2 Blue Corner Lower Left
> <-2.5,-7.5,0>, file://3-5 Yellow Lower Mid-Left
> <2.5,-7.5,0>,  file://6-8 Yellow Lower Mid-Right
> <7.5,-7.5,0>, file://9-11 Blue Corner Lower Right
> file://Second Row
> <-7.5,-2.5,0>,  // 12-14 Yellow Left Lower Mid
> <-2.5,-2.5,0>, file://15-17 Green Center LL
> <2.5,-2.5,0>,  file://18-20 Green Center LR
> <7.5,-2.5,0>,  file://21-23 Yellow Right Lower Mid
> file://Third Row
> <-7.5,2.5,0>, file://24-26 Yellow Left Upper Mid
> <-2.5,2.5,0>, file://27-29 Green Center UL
> <2.5,2.5,0>,  file://30-32 Green Center UR
> <7.5,2.5,0>,  file://33-35 Yellow Right Upper Mid
> file://Top Row
> <-7.5,7.5,0>, file://36-38 Blue corner Upper Left
> <-2.5,7.5,0>, file://39-41 Yellow Upper Mid-Left
> <2.5,7.5,0>, file://42-44 Yellow Upper Mid-Right
> <7.5,7.5,0> file://45-47 Blue Corner Upper Right
> }
>
> #macro Patcher(Patch,Vertex,Wire,Color,XRay)
> union {
> #if (Patch = 1)
> bicubic_patch {
> type 1
> flatness 0.01
> u_steps 3
> v_steps 3
> Points[0]Points[1]Points[2]Points[3]
> Points[4]Points[5]Points[6]Points[7]
> Points[8]Points[9]Points[10]Points[11]
> Points[12]Points[13]Points[14]Points[15]
> pigment {Color #if(XRay=1) filter .6 #end}}
> #end
>
> #if(Vertex=1)
> union {
> sphere {Points[0],.2 pigment {Blue}}
> sphere {Points[1],.2}
> sphere {Points[2],.2}
> sphere {Points[3],.2 pigment {Blue}}
> sphere {Points[4],.2}
> sphere {Points[5],.2 pigment {Green}}
> sphere {Points[6],.2  pigment {Green}}
> sphere {Points[7],.2}
> sphere {Points[8],.2}
> sphere {Points[9],.2 pigment {Green}}
> sphere {Points[10],.2 pigment {Green}}
> sphere {Points[11],.2}
> sphere {Points[12],.2  pigment {Blue}}
> sphere {Points[13],.2}
> sphere {Points[14],.2}
> sphere {Points[15],.2  pigment {Blue}}
> pigment {Yellow} no_shadow} #end
>
> #if(Wire=1)
> union {
> cylinder {Points[0],Points[1],.1}
> cylinder {Points[1],Points[2],.1}
> cylinder {Points[2],Points[3],.1}
> cylinder {Points[4],Points[5],.1}
> cylinder {Points[5],Points[6],.1}
> cylinder {Points[6],Points[7],.1}
> cylinder {Points[8],Points[9],.1}
> cylinder {Points[9],Points[10],.1}
> cylinder {Points[10],Points[11],.1}
> cylinder {Points[12],Points[13],.1}
> cylinder {Points[13],Points[14],.1}
> cylinder {Points[14],Points[15],.1}
> cylinder {Points[0],Points[4],.1}
> cylinder {Points[4],Points[8],.1}
> cylinder {Points[8],Points[12],.1}
> cylinder {Points[1],Points[5],.1}
> cylinder {Points[5],Points[9],.1}
> cylinder {Points[9],Points[13],.1}
> cylinder {Points[2],Points[6],.1}
> cylinder {Points[6],Points[10],.1}
> cylinder {Points[10],Points[14],.1}
> cylinder {Points[3],Points[7],.1}
> cylinder {Points[7],Points[11],.1}
> cylinder {Points[11],Points[15],.1}
> pigment {Red} no_shadow}
> #end } #end
>
>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 2002/01/21


Post a reply to this message

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