POV-Ray : Newsgroups : povray.newusers : Dynamic Prisms Server Time
26 Nov 2024 10:23:58 EST (-0500)
  Dynamic Prisms (Message 1 to 2 of 2)  
From: Administrator
Subject: Dynamic Prisms
Date: 8 Aug 2004 01:20:00
Message: <web.4115b6f927ac47e07f3aa99d0@news.povray.org>
Is it possible to provide the prism construct with vertex coords from an
array?  I have the coordinates generated and in an array but if I use the
array variable instead of literal values it gives me a parse error saying,
"Expected 'numeric expression', array identifier found instead".  Any
ideas?

Thanks in advance!

Tim

My email is twy@_n0$p@m_shawbiz.ca.  Just remove the underscores and the
stuff between them.


Post a reply to this message

From: ingo
Subject: Re: Dynamic Prisms
Date: 8 Aug 2004 03:14:39
Message: <Xns953F5E08DFC09seed7@news.povray.org>
in news:web.4115b6f927ac47e07f3aa99d0@news.povray.org Administrator
wrote: 

> Is it possible to provide the prism construct with vertex coords from
> an array?

You have to get the values from the array 'manually', the prism won't do 
it for you, see example below:

---%<------%<---

#declare A=array[5]{<1,0>,<0,1>,<-1,0>,<0,-1>,<1,0>}

#declare NrPoints=dimension_size(A,1);

prism{
  linear_spline
  linear_sweep
  0,
  1,
  NrPoints,
  #declare I=0;
  #while (I<NrPoints)
    #local P=A[I];
    P
    #declare I=I+1;
  #end
  pigment { rgb 1}
}

---%<------%<---


Ingo


Post a reply to this message

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