POV-Ray : Newsgroups : povray.newusers : Help with If statements Server Time
25 Dec 2024 11:16:32 EST (-0500)
  Help with If statements (Message 1 to 3 of 3)  
From: quoderatd
Subject: Help with If statements
Date: 9 Jul 2007 23:55:02
Message: <web.4693029788b746da1c9e60d70@news.povray.org>
#if (vangle(vec2, chiral) > 0 | vangle (vec2, chiral) = 0)
vaxis_rotate(vecb, chiral, a2* 2* pi/circum)
else
vaxis_rotate(vecb, chiral, -a2* 2* pi/circum)

and i get
Parse Error: Expected 'numberic expression', undeclared identifier 'vangle'
found instead

And
So I tried declaring a variable
#declare vecra = (vangle(vec1, chiral));
but
Parse Error: Expected 'numberic expression', undeclared identifier 'vangle'
found instead

vangle is a function i can but....

and something about vangle..

let's say if i put vangle (v1,v2) = 60

then will vangle (v2,v1) = 300?
or -60?


Post a reply to this message

From: Slime
Subject: Re: Help with If statements
Date: 10 Jul 2007 00:46:24
Message: <46930f20$1@news.povray.org>
> Parse Error: Expected 'numberic expression', undeclared identifier
'vangle'
> found instead

Capitalization matters: try VAngle. (Or VAngleD if you're expecting degrees
instead of radians.)

> and something about vangle..
>
> let's say if i put vangle (v1,v2) = 60
>
> then will vangle (v2,v1) = 300?
> or -60?

No, they'll both return 60. In 3D space, the angle between two vectors is
always between 0 and 180.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Alain
Subject: Re: Help with If statements
Date: 10 Jul 2007 09:19:42
Message: <4693876e$1@news.povray.org>
quoderatd nous apporta ses lumieres en ce 2007/07/09 23:52:
> #if (vangle(vec2, chiral) > 0 | vangle (vec2, chiral) = 0)
> vaxis_rotate(vecb, chiral, a2* 2* pi/circum)
> else
> vaxis_rotate(vecb, chiral, -a2* 2* pi/circum)
> 
> and i get
> Parse Error: Expected 'numberic expression', undeclared identifier 'vangle'
> found instead
> 
> And
> So I tried declaring a variable
> #declare vecra = (vangle(vec1, chiral));
> but
> Parse Error: Expected 'numberic expression', undeclared identifier 'vangle'
> found instead
> 
> vangle is a function i can but....
> 
> and something about vangle..
> 
> let's say if i put vangle (v1,v2) = 60
> 
> then will vangle (v2,v1) = 300?
> or -60?
> 
> 
> 
Make sure that you included the file "math.inc" that contains the definitions 
for those macros.
Capitalisation DOES mather: vangle and VAngle are 2 distinct macro names.
VAngle(V1,V2) return the result as radiant.
VAngleD(V1,V2) return the result as degrees.

-- 
Alain
-------------------------------------------------
At twenty years of age the will reigns; at thirty, the wit; and at forty, the 
judgment.
Benjamin Franklin


Post a reply to this message

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