Results 1 to 7 of 7

Thread: Drawing animations, Speed and time control

  1. #1
    Join Date
    Mar 2012
    Location
    Urduliz, Spain
    Posts
    65

    Default Drawing animations, Speed and time control

    Working with DrLava's Universal Library UDAC + ETHERDERAM + MODIFIED Nagilos C# wrapper

    Solved the blanking and optimizaton problems!!

    Now Im working with animations, I want to move a line from point A to point B this is not a problem, the problem comes when I want to move this line from point A to point B for example in 6 seconds.

    We have the npps value in the Universal Library LDL_DAC_Write_Frame function, Im a bit messy with this value, The problem is if I draw a LIne with animation from Point A to point B and give a specific value to npps in order to get a 6seconds time for the line to go from A to B and the I add another form, with or without animatiion that doesnt matters, in my canvas, this means more points to be painted so the animation comes slower and now the line spends more than 6 seconds to go from A to B.

    Im working on the idea of readjusting the npps value counting the points added with new forms in canvas, so if the line was going from A to B with npps=800 and 50 points, if the new form is 25 points the new value for npps must be new npps=800*75/50.

    I will tell you when i try this.

    Any other idea on how to solve this, or how to DRAW with a time line or something like that.

    Thanks in advance

  2. #2
    Join Date
    Feb 2009
    Location
    East Coast of Southern Virginia
    Posts
    536

    Default

    That is a very good question. In most of my software I have the frames buffered by a FIFO. If a frame is to be written but there is still a frame being played I simply drop the frame(s). That way you can separate your animation code section from your output section and output to any device regardless of the speed. Using this method your animation is always in sync. I find this to work well.

    You can alternatively as you suggested vary the output point rate however some devices do not have an infinitely adjustable output rate. You can take the output rate the user set to be MAX output rate ... there is another caveat though ... when audience scanning you do not want your output rate to drop too much as this causes the beam to dwell in one spot longer than intended....

    Anyone else have any advice? I am curious to know too.

  3. #3
    Join Date
    Mar 2012
    Location
    Urduliz, Spain
    Posts
    65

    Default

    Hi cfavreau

    Thanks for the ideo of using FIFO, just one question when you talk about dropping frames, that means not to draw that dropped frame?

    About using always the Max output rate, I have tested it already, but the the laser or the DAC becomes crazy when youre drawing with a low quantity of points. I mean you put the rate on 16000, and I draw a simple square with 50 points, it just crash, the laser tries to paint them too fast and becomes crazy. May be Im doing something wrong, dont know.

    I will continue testing, anda advice if i get to one solution diferent than FIFO or MAX output rate.

  4. #4
    Join Date
    Feb 2009
    Location
    East Coast of Southern Virginia
    Posts
    536

    Default

    You basically add new frames to the FIFO. When your hardware is ready to play the next frame you just dump (not play/discard) all of the frames but the last one in the FIFO which will be the newest frame. This ensures you will always be synchronized with the frame that the upper animation layer wants to play.

    I am not sure about the DAC behavior. It might come from gaps in the frame to frame timing. It sounds like an issue with the DAC you are using though. You might try to solve this by adding more points (duplicating points) to hit a minimum points per frame or just simply copying the same frame over into the same frame buffer until you exceed a minimum number of points (you will have to determine by experimentation maybe). It mi diaght simply be that your scanners cannot display that frame at 16kpps in which you need to slow it down by duplicating points. You need to pay attention to the speed/velocity and acceleration of the scanners. This is very important. The maximum point output rating is not good for points that are far apart.

  5. #5
    Join Date
    Mar 2012
    Location
    Urduliz, Spain
    Posts
    65

    Default

    Hi there

    Problem with animations solved. At the end the main thing was to keep pps value at maximum for my scanner, and calaculate needed frames to move from point A to point B for example in 5 seconds. When I have the number of frames needed I just calculate coordinates for those frames and paint them.

    I needed a new list of lists structure to control all forms in the canvas but everything is easier now with C#, thanks Nagilo!!!

    Any questions..

  6. #6
    Join Date
    Feb 2009
    Location
    East Coast of Southern Virginia
    Posts
    536

    Default

    I think I mis understood your initial question ... Doh! I thought you already had some predefined frames... but you really just want to draw a line AB (represented by points A and B) and move it to a new set of coordiates C and D over a period of time? Is that what you are doing?

  7. #7
    Join Date
    Mar 2012
    Location
    Urduliz, Spain
    Posts
    65

    Default

    HI chris,

    Yes Im with the first steps, move a line AB to CD in a specific time like 6 seconds. I have solved this as I told yesterday, calculating frames needed for a specific time lapse.

    Now I can add more forms like 3 squares, and make them move in different ways without affecting quality and speed. I must tell the software that the animation will have a specific time duration, I say duration=6 secs, then I draw the animation in the canvas, then my software calculates the needed frames to make the 3 squares move like I draw in the animation within 6 seconds, I press Play and the show begins.

    It looks great!!!!

    One question?

    If I want to give different times for each of the squares, I mean I have 3 squares and I want them to move at different speeds.
    -Square 1 go from A to B in 3 secs,
    -Square 2 go from C to D in 6 secs
    -Square 3 go from E to F in 10 secs.

    is this possible?

    I think not but not sure.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •