POV-Ray : Newsgroups : povray.newusers : functions/macros and global variables Server Time
29 Jul 2024 12:26:20 EDT (-0400)
  functions/macros and global variables (Message 1 to 1 of 1)  
From: pare03
Subject: functions/macros and global variables
Date: 28 Sep 2005 15:10:00
Message: <web.433ae9312aa167e329d68ff20@news.povray.org>
Hi,

I'm trying to do an animation that position an object in a scene using 6
degrees of liberty (x, y, z, roll, pitch, yaw). The algorithm that compute
the value of these 6 varables can be complex, so I thought it would be a
good idea to separate all these variables & calculations in a separate
Animations.inc file - and since the main *.pov file does not have to know
all these variables, only add some Get() and Set() functions, like:

Get_Roll_Position(ClockValue){ ... }
Get_Pitch_Position(ClockValue){ ... }

Set_Roll_Resolution(MinimumRollValue, MaximumRollValue, RollResolution){ ...
}
Set_Pitch_Resolution(MinimumRollValue, MaximumRollValue, RollResolution){
.... }

The main problem is that these functions would have to use global variables
.... Is there a way to make functions/macros use global variables (these
variables are floats only) ?  Or will I have to put everything I need into
function parameters ?

Am I trying too hard to program like I would do in C++ ??? :)

Thank you very much,
David.


Post a reply to this message

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