POV-Ray : Newsgroups : povray.advanced-users : distinguishing types in scene language : Re: distinguishing types in scene language Server Time
3 May 2024 03:43:20 EDT (-0400)
  Re: distinguishing types in scene language  
From: Ron Parker
Date: 25 Sep 2000 00:47:10
Message: <slrn8stn19.6ca.ron.parker@fwi.com>
On Sun, 24 Sep 2000 22:08:05 +0100, Neil Freebairn wrote:
>Is there any way to tell a identifier which evaluates to a vector from an
>identifier which evaluates to a real? 

(reply confined to advanced-users, which is the most appropriate of the 
crossposted groups.)

If what you're going to get is guaranteed to be either a scalar or a 3-d
vector, you can do something like this:

#macro scalar_or_vector( A )
        
  #declare C = rgbft 0 + A;
        
  #if ( C.filter = C.red ) 
    #debug "scalar\n"
  #else
    #debug "vector\n"
  #end
    
#end  


-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
Proudly not helping RIAA and SDMI steal my rights -- 
  http://www.eff.org/Misc/EFF/Newsletters/EFFector/HTML/effect13.08.html


Post a reply to this message

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