POV-Ray : Newsgroups : povray.general : how to implement it ? polygon and splines Server Time
2 Aug 2024 12:21:35 EDT (-0400)
  how to implement it ? polygon and splines (Message 1 to 4 of 4)  
From: khayyam
Subject: how to implement it ? polygon and splines
Date: 16 Nov 2004 06:45:01
Message: <web.4199e8044d5e34fca3be01c60@news.povray.org>
hello everybody

i've got a little syntaxical problem, I would like to define a polygon whose
points comes from a spline that I'm covering.

I would like to do something like that :

#declare MySpline =
  spline {
    natural_spline
    0,  <0,1,0>
    .5, <.5,.6,0>
    1,  <1,1,0>
  }

#declare i=0;
polygon{10,
  #while (i<10)
     MySpline(i)
     #declare i=i+1;
  #end
pigment{Red}
}

but of course, it doesn't work, it brings a parse error. How should I do ?
Thanks for your help.


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: how to implement it ? polygon and splines
Date: 16 Nov 2004 07:05:04
Message: <Xns95A385755DC73raf256com@203.29.75.35>
kha### [at] hotmailcom
news:web.4199e8044d5e34fca3be01c60@news.povray.org 

> I would like to do something like that :
> #declare MySpline =
>   spline {
>     natural_spline
>     0,  <0,1,0>
>     .5, <.5,.6,0>
>     1,  <1,1,0>
>   }
> #declare i=0;
> polygon{10,
>   #while (i<10)
>      MySpline(i)
>      #declare i=i+1;
>   #end
> pigment{Red}
> }
> but of course, it doesn't work, it brings a parse error. How should I
> do ? Thanks for your help.

This do work if You use  MySpline(i/10) because spline has points 0..1 not 
0..10


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Warp
Subject: Re: how to implement it ? polygon and splines
Date: 16 Nov 2004 07:43:35
Message: <4199f5f7@news.povray.org>
Rafal 'Raf256' Maj <spa### [at] raf256com> wrote:
> This do work if You use  MySpline(i/10) because spline has points 0..1 not 
> 0..10

  Also 'polygon' takes 2-dimensional vectors so it might be necessary to
convert the three-dimensional spline vectors to two-dimensional.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: how to implement it ? polygon and splines
Date: 16 Nov 2004 07:47:27
Message: <Xns95A38CA4C92A6raf256com@203.29.75.35>
war### [at] tagpovrayorg news:4199f5f7@news.povray.org

>   Also 'polygon' takes 2-dimensional vectors so it might be necessary to
> convert the three-dimensional spline vectors to two-dimensional.

In this case it worked, just place camera properly or rotate figure by x*90

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

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