Re: Smoothly rotating to another angle on pano nodes
Status: Alpha
Brought to you by:
cwalther
|
From: James C. W. <jfc...@ya...> - 2009-12-30 00:01:13
|
Sorry for the late reply; holidays and all that. Thanks for the clarifaction. One problem that I've discovered with the "check if current direction ~ target direction and then angle the camera to precisly equal the target" is that if I pan myself while the program is running, the program loses track of where it's going, and hits the 80 EL pan limit, slowely spinning on the vertical access. Obviously, to make any of this effective the panorama must be frozen from player control. But since there's not any way to do that yet, I need to use the one that won't hit a dead end, and right now that's the version that checks how many times the function has run...Any suggestions? Thanks, James --- On Mon, 12/21/09, Christian Walther <cwa...@gm...> wrote: From: Christian Walther <cwa...@gm...> Subject: Re: Smoothly rotating to another angle on pano nodes To: pip...@li... Date: Monday, December 21, 2009, 4:49 AM James C. Wilson wrote: > >- Why are you putting the parameters into global variables instead of > >passing them to the autoPan function as arguments? You could also put > >the intermediate results (autoPan_funcCount etc.) into local variables > >of the autoPan function, they are visible from the inner function > Could you tell me how these are done? I can't find any examples in the > demo or in Lua refman, maybe I'm looking in the wrong places... > I tried putting the variables into the function as locals, right inside > the function autoPan() declaration, and this works with the default > values, but I don't know how to "contact" and alter the state of these > while calling the function. You don't need to "contact" the local variables, you pass the ones you need to set from outside as arguments. From inside, they are treated indentically to local variables. Like this: function autoPan(tarAZ, tarEL, time) local rate = 0.025 local iterCount = time/rate --... pipmak.schedule( rate, function() --do something involving tarAZ, tarEL, time, rate, iterCount, ... end ) end and then you call it as autoPan(270, 4, 1) -Christian ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Pipmak-Users mailing list Pip...@li... news://news.gmane.org/gmane.games.devel.pipmak.user https://lists.sourceforge.net/lists/listinfo/pipmak-users |