POV-Ray : Newsgroups : povray.newusers : Problem with macros and translate function :/ : Re: Problem with macros and translate function :/ Server Time
20 May 2024 02:47:38 EDT (-0400)
  Re: Problem with macros and translate function :/  
From: jr
Date: 23 Aug 2023 12:55:00
Message: <web.64e6394bd6a8965b80c03e9d6cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] gmailcom> wrote:
> ...
> Quickly:

should have stopped for coffee.  </grin>


> the trans() macro doesn't know the values of 'i' and 'ang'.
> Either declare these variables globally, or pass them as parameters.

'ang' is global, '#declare'd.  but (sorry) you're wrong re the 'i', see below.
without passing it as an argument cannot modify it though.

and to clarify:
> use '#local' inside macros, rather than '#declare's.

unless you do want to modify global variables.


regards, jr.

-----<snip>-----
#version 3.7;

global_settings {assumed_gamma 1}
box {0,1}

#declare foo_ = 12345;

#macro m_b()
  #debug concat("foo ",str(foo_,0,0)," bar ",str(bar_,0,0),".\n")
#end

#macro m_a()
  #local bar_ = 67890;
  m_b()
#end

m_a()


Post a reply to this message

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