<div dir="ltr"><div>With 'record?' I don't see this in the gif, but do see it on-screen, which is curious. Maybe a hardware acceleration bug? Also don't see it if I render the scene in the interactions window. I only see it when running with big-bang.<br><br></div>If I change the initial state to 100 I don't see this. It only happens on low y value.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 8:52 AM, Spencer florence <span dir="ltr"><<a href="mailto:spencerflorence@gmail.com" target="_blank">spencerflorence@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><div>huh, I’m unable to reproduce this as well.</div>
<div><br></div>
<div>Brian, if you use the `record?` clause in big-bang do you see the same behavior in the generated gif? [ add (record? "/tmp”) to the big-bang expression, similar to what Matthias did in his example ]</div>
<div><br></div>
<div>Also do you see the same behavior if you change the initial state to be 100?</div><span class="HOEnZb"><font color="#888888">
<div><br></div>
<div>—Spencer</div></font></span></span><div class="HOEnZb"><div class="h5"><div><br></div>
<br><br><div class="gmail_quote"><p>On Mon, Oct 6, 2014 at 10:05 AM, Brian Craft <span dir="ltr"><<a href="mailto:bcboy@thecraftstudio.com" target="_blank">bcboy@thecraftstudio.com</a>></span> wrote:<br></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>If I record to a gif the effect isn't in the gif, though it does happen on-screen while it is recording the gif. Here's a video, using a camera phone. Sorry for the poor quality.<br><br><a href="https://drive.google.com/file/d/0BxB9fW-JZz-ST3dfeFNxakRhMnRzcGtPQUtuaWJxMVRQTEFz/view" target="_blank">https://drive.google.com/file/d/0BxB9fW-JZz-ST3dfeFNxakRhMnRzcGtPQUtuaWJxMVRQTEFz/view</a><br><br></div>Pause it around the 1 sec mark.<br></div>
<div class="gmail_extra">
<br><div class="gmail_quote">On Mon, Oct 6, 2014 at 7:10 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sorry, I don't understand what you mean. I have modified the main function so that (1) the whole thing is slower and (2) it records the whole thing as an animated gif:<br><br>
(define (main)<br>
(big-bang 0 ;; initial state<br>
(record? #t) ;; <---------------<br>
(on-tick add-3-to-state 1/10) ;; when the clock ticks, add ... <-------------<br>
(to-draw draw-a-ufo-onto-an-empty-scene) ;; when the state changes, draw ...<br>
(stop-when state-is-300))) ;; when the UFO's y coordinate is 300, stop.<br><br><br><br>
The animated gif is here:<br><br>
<a href="http://www.ccs.neu.edu/home/matthias/Tmp/UFO/i-animated.gif" target="_blank">http://www.ccs.neu.edu/home/matthias/Tmp/UFO/i-animated.gif</a><br><span><font color="#888888"><br>
-- Matthias<br></font></span><div><div>
<br><br><br>
On Oct 5, 2014, at 11:52 PM, Brian Craft <<a href="mailto:bcboy@thecraftstudio.com" target="_blank">bcboy@thecraftstudio.com</a>> wrote:<br><br>
> The same effect occurs in racket/share/pkgs/realm/chapter5/ufo-source.rkt. When the state is increasing from 0, the image is not moving down the screen. It stays in one place, but is initially clipped to 0 horizontal lines. Then 1 line, then 2, and only when the state is 1/2 the image height does it start moving down the screen.<br>
><br>
> Also, if I call (draw-a-ufo-onto-an-empty-scene 0) in the interactions window, I once again get a different result: it renders the lower half of the image. This is the same behavior I see with my code.<br>
><br>
> Maybe a platform issue? (version) reports 6.0. I'm running it on ubuntu.<br>
><br>
><br>
><br>
> On Sun, Oct 5, 2014 at 6:13 PM, Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>> wrote:<br>
><br>
> Can you send the full program please? Thanks -- Matthias<br>
><br>
><br>
><br>
> On Oct 5, 2014, at 8:52 PM, Brian Craft wrote:<br>
><br>
> > Hello -- Newbie here. I'm going through "Realm of Racket". I'm seeing an odd effect when using this to-draw handler in big-bang:<br>
> ><br>
> > (define (draw-a-ufo-onto-an-empty-scene game)<br>
> > (let ([pos (game-pos game)])<br>
> > (place-image IMAGE-of-UFO (round (vec-x pos)) (round (vec-y pos))<br>
> > (empty-scene WIDTH HEIGHT))))<br>
> ><br>
> > vec is (struct vec (x y))<br>
> ><br>
> > As the y coordinate approaches zero, IMAGE-of-UFO gets clipped on the top and bottom, looking a bit like it's winking out of existence, rather than sliding off the canvas. This doesn't happen on any other edge. It's only as y approaches zero. It starts when the edge of the image meets the edge of the scene. That is, if the image is 20px high, and y starts at 30, and decreases by 1 on each tick, it will move up the canvas for 30..10, but from 10 on the image will not change position, but will instead be clipped on the top & bottom, until it disappears.<br>
> ><br>
> > This does not happen in the interactions window. If I call the above function in the interactions window, it renders as expected, with the image moving smoothly off the edge.<br>
> ><br>
> ><br>
> > ____________________<br>
> > Racket Users list:<br>
> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
><br><br></div></div>
</blockquote>
</div>
<br></div>
</blockquote></div><br></div></div></blockquote></div><br></div>