|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Guys,
Thought you might be interested in how I solved that acceleration issue I
posted. I wanted an object to move at a constant and increasing rate, so this
is what I came up with.
#fopen fileSpeed "speed.txt" read
#read (fileSpeed, speedValue)
#fclose fileSpeed
#debug concat("speedValue: ", str(speedValue,3,3), "\n")
#local delta = floor(frame_number / 10)*0.01; //Increase every 10 frames
#local Speed = speedValue + 0.1 + delta; // Where 'speedValue' is read in from
the file
sphere { <0, 0, 0>, 1
pigment { Blue }
translate -0.5*x
}
translate <-5.5.0.0>
translate <Speed,0,0>
}
#fopen filespeed "speed.txt" write
#write (filespeed, Speed)
#fclose filespeed
With this particular example the speed will increase every 10 frames
consistently. Thanks to jfilip for the help.
Now on the question #2, I have to find a way so that when the object gets to the
edge of the image, it will turn and go the other way, and once it hits the other
edge of the image turn again and go forward. Any suggestions? I tried a loop
that would write a negative Speed to my text file, but I end up with an
animation that just jumps from one end of the image to the other every frame.
;(
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"RC" <nomail@nomail> wrote:
> Now on the question #2, I have to find a way so that when the object gets to the
> edge of the image, it will turn and go the other way, and once it hits the other
> edge of the image turn again and go forward. Any suggestions? I tried a loop
> that would write a negative Speed to my text file, but I end up with an
> animation that just jumps from one end of the image to the other every frame.
> ;(
Maybe you want to inverse the acceleration once you reach the center of the
screen.
Or do you want it to just bounce back and forth then at a constant speed (but
changing direction)?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ya, the idea is that it could bounce back and forth, and I could render any
number of frames. I guess I'm going to have to find a way to change the Speed
to Speed = speedValue - 0.1 - delta;
"clipka" <nomail@nomail> wrote:
> "RC" <nomail@nomail> wrote:
> > Now on the question #2, I have to find a way so that when the object gets to the
> > edge of the image, it will turn and go the other way, and once it hits the other
> > edge of the image turn again and go forward. Any suggestions? I tried a loop
> > that would write a negative Speed to my text file, but I end up with an
> > animation that just jumps from one end of the image to the other every frame.
> > ;(
>
> Maybe you want to inverse the acceleration once you reach the center of the
> screen.
>
> Or do you want it to just bounce back and forth then at a constant speed (but
> changing direction)?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"RC" <nomail@nomail> wrote:
> Ya, the idea is that it could bounce back and forth, and I could render any
> number of frames. I guess I'm going to have to find a way to change the Speed
> to Speed = speedValue - 0.1 - delta;
Ah, that's an easy one:
#declare Speed = speedValue + sgn(speedValue)*(0.1 + delta);
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|