POV-Ray : Newsgroups : povray.advanced-users : Problems with #default and #ifdef : Problems with #default and #ifdef Server Time
29 Jul 2024 22:26:35 EDT (-0400)
  Problems with #default and #ifdef  
From: Nicolas Calimet
Date: 21 Nov 2000 10:02:29
Message: <3A1A9FCC.278FA382@free.fr>
Hi,

	Long time ago I noticed POV-Ray 3.1g (UNIX) had problems when
using the following code. Should it be considered as a bug or am I
missing something ? Also I wonder why it's not possible to use a
material{} statement in #default{} (but only texture|pigment|finish|
normal as the docs say).

//-----------------------------------------------------------------
#version 3.1;

sphere{<0,0,5>,1 pigment{rgb 0}}

//#declare test = 1;
#ifdef(test) #render "\ntest\n" #end                       // works
#ifdef(test) #render str(test,0,6) #end                    // works
#ifdef(test) #declare a = test; #end                       // works
#ifdef(test) #declare t = texture{pigment{rgb test}} #end  // works

// all next stop on error due to unknown variables

#ifdef(test) #default{texture{pigment{rgb test}} #end

//#declare my_pig = pigment{rgb 1}
#ifdef(my_pig) #default{pigment{my_pig}} #end

//#declare my_finish = finish{reflection 0.5} #end
#ifdef(my_finish) #default{finish{my_finish}} #end

//#declare my_norm = normal{bumps 1}
#ifdef(my_norm) #default{normal{my_norm}}  #end

//#declare my_texture = texture{pigment{rgb 1}}
#ifdef(my_texture) #default{texture {my_texture}} #end
//-----------------------------------------------------------------


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

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