POV-Ray : Newsgroups : povray.newusers : using coordinate vectors in #if statements : Re: using coordinate vectors in #if statements Server Time
30 Jul 2024 00:25:39 EDT (-0400)
  Re: using coordinate vectors in #if statements  
From: kurtz le pirate
Date: 11 Dec 2004 12:15:02
Message: <kurtzlepirate-4F42D3.18150211122004@news.povray.org>
In article <web.41bb1118d37e6b4d5ca17c0e0@news.povray.org>,
 "Floyd" <nomail@nomail> wrote:

>>I'm using trace() to place objects on a height-field, but I don't want to
>>place them above a certain elevation.  I tried using an
>>
>>#if (y > 10)
>>
>>statement to remove the objects above y=10 out of view, but I get a parser
>>error back that y is a vector, <0,1,0>, and a float is expected.  How do I
>>extract the value of y out of the coordinate vector for conditional
>>testing?
>>
>>Thanks,
>>Floyd

  hum...
  try this kind of code :

  #declare normalHF = <0.00, 0.00, 0.00>;
  #declare testPoint = <thisX, 0.50, thisZ>;
  #declare vectorHF = y;
  #declare yHF = trace (thisHF, testPoint,vectorHF, normalHF);

  #if(yHF>1)
    place object
  #end



  klp


Post a reply to this message

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