POV-Ray : Newsgroups : povray.general : Array of points for use with bicubic patch : Re: Array of points for use with bicubic patch Server Time
29 Jul 2024 14:18:11 EDT (-0400)
  Re: Array of points for use with bicubic patch  
From: D103
Date: 25 Apr 2011 19:30:00
Message: <web.4db603442d1676e497b020200@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
>
> Have you read
>
> >
http://wiki.povray.org/content/Documentation:Tutorial_Section_3#Bicubic_Patch_Object
>
> ?
Yes, I have, and with previous patches I used a similar method, but I'm trying
to find an easier way to control and change the points, for example, all the
points along a certain axis etc.
>
> The corner of each grid should match. (aka, duplicate them)
> The control points along the jointing line should also.
>
> Do you really want to manage the 16 points of patch with 0-15, or use a
> double index 0-3,0-3 instead ?
>
> (array[n][4][4])
>
> Or even simpler to understand: array[n][m][4][4]
> n height
> m width (as number of patch)

Hadn't thought of that, thanks.

Supposing I set up such an array, could I use it like this:


#declare P1 = 1;
#declare P2 = 1;
#while(P1<=4&P2<=4)
  bicubic_patch {
    type 1 u_steps 5 v_steps 5
    BPatchPoints[1][1][P1][P2]
  }
  bicubic_patch {
    type 1 u_steps 5 v_steps 5
    BPatchPoints[2][2][P1][P2]
  }
  bicubic_patch {
    type 1 u_steps 5 v_steps 5
    BPatchPoints[2][2][P1][P2]
  }
  bicubic_patch {
    type 1 u_steps 5 v_steps 5
    BPatchPoints[2][2][P1][P2]
  }
  #declare P1=P1+1;
  #if (P1=4)
    #declare P2=P2+1;
    #declare P1=1;
  #end
#end

Something tells me this isn't going to work, but I think that's the general idea
there.


Post a reply to this message

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