|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Why isn't this working?
The correct behaviour should be an animation where
the ship spins 360 degrees(10 degrees per frame). Once
it has completed 1 rotation it moves away from the camera
and spins again.
The ship spins just fine but I can't get it to move away from
the camera.
#declare NumColumns = 24;
#declare Columns = 0;
#declare NumRows = 36;
#declare Rows = 0;
#while(Columns < NumColumns)
#while(Rows < NumRows)
#declare T = Columns *40;
object {ship rotate clock*z*360
translate < 0, T, T> }
#declare Rows = Rows + 1;
#end
#declare Columns = Columns + 1;
#end
--
Phil
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I should probably mention that the camera is
rotated at x*-45 which is why "T" is in both
y and z .
--
Phil
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 15 Jan 2003 03:15:39 +0000, Phil Clute wrote:
> Why isn't this working?
> The correct behaviour should be an animation where the ship spins 360
> degrees(10 degrees per frame). Once it has completed 1 rotation it moves
> away from the camera and spins again.
> The ship spins just fine but I can't get it to move away from the camera.
>
>
>
> #declare NumColumns = 24;
> #declare Columns = 0;
> #declare NumRows = 36;
> #declare Rows = 0;
>
> #while(Columns < NumColumns)
> #while(Rows < NumRows)
> #declare T = Columns *40;
> object {ship rotate clock*z*360
> translate < 0, T, T> }
> #declare Rows = Rows + 1;
> #end
> #declare Columns = Columns + 1;
> #end
Rows has to be reinitialised to 0 inside the Columns loop.
The second time through the Columns loop Rows still has the value NumRows,
so the Rows loop will not be executed.
#declare NumColumns = 24;
#declare NumRows = 36;
#declare Columns = 0;
#while(Columns < NumColumns)
#declare Rows = 0;
#while(Rows < NumRows)
#declare T = Columns *40;
object {ship rotate clock*z*360
translate < 0, T, T> }
#declare Rows = Rows + 1;
#end
#declare Columns = Columns + 1;
#end
I believe that keeping the initialiser close to the #while loop makes it
clearer. I usually do it as
#declare N = 0; #while( N < Limit)
....
#declare N=N+1; #end
so that it looks more like a for() loop
Cheers,
PoD.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This might be of some help:
http://iki.fi/warp/povQandT/whileloops.html
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks guys.
I was doing it all wrong. I was creating a bunch
of ships when I only wanted 1, like this...
#declare T = floor(clock)*2;
object {ship rotate clock*z*360
translate < 0,T, T> }
As usual I was trying to use way more code than I
needed. What's more, I found the function I was
looking for(in Game Maker image_scale)so I wont
need to use this anyhow. It figures.
--
Phil
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |