POV-Ray : Newsgroups : povray.general : condition parsed as vector : Re: condition parsed as vector Server Time
8 Aug 2024 06:14:43 EDT (-0400)
  Re: condition parsed as vector  
From: Tor Olav Kristensen
Date: 15 Feb 2001 19:21:54
Message: <3A8C7265.8ABD747@hotmail.com>
KalleK wrote:
> 
> Thank you, Thorsten.
> I will write a little #macro that fit my needs (that is the condition is only true
if the vectors
> are exactly the same - what I thought (Vector1=Vector2) would do)

Hello Kalle

You don't need a macro to do that.

This expression will help you to achieve the same:

vlength(Vector2 - Vector1)


Your (illegal) code;

#local T0 = x;
#local T1 = 1;
#local T1 = (T0=y);

could then be written like this:

#local T0 = x;
#local T1 = (vlength(y - T0) = 0);


You could even write the last line like this:

#local T1 = (!vlength(y - T0));

(But I will not recommend doing it that way.)


And, as you probably already know, you can
now use the T1 variable within other boolean
expressions.

E.g.:

#if (T1)
  #debug "T0 is equal to <0, 1, 0>"
#end


-- 
Best regards,

Tor Olav

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok


Post a reply to this message

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