POV-Ray : Newsgroups : povray.general : I give up... Server Time
5 Nov 2024 20:20:06 EST (-0500)
  I give up... (Message 1 to 5 of 5)  
From: Phil Clute
Subject: I give up...
Date: 15 Jan 2003 03:14:54
Message: <3e25187e@news.povray.org>
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

From: Phil Clute
Subject: Re: I give up...
Date: 15 Jan 2003 03:17:28
Message: <3e251918@news.povray.org>
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

From: PoD
Subject: Re: I give up...
Date: 15 Jan 2003 05:58:37
Message: <pan.2003.01.15.10.58.35.607177@internode.on.net>
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

From: Warp
Subject: Re: I give up...
Date: 15 Jan 2003 08:49:12
Message: <3e2566d8@news.povray.org>
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

From: Phil Clute
Subject: Re: I give up...
Date: 15 Jan 2003 16:58:35
Message: <3e25d98b@news.povray.org>
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

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