________________________________________
From: Schwab,Wilhelm K
Sent: Friday, November 26, 2010 4:13 PM
To: [email protected]
Subject: RE: [Plplot-general] plplot and animation

If you want a Matlab-like system, take a look at Octave:

   http://www.gnu.org/software/octave/

I would probably tackle the problem using Smalltalk, which you can obtain in 
the form of Pharo from

  http://pharo-project.org/home

Have a look at the BouncingAtomMorph.  Another option would be to make a series 
of images and glue them together using mencoder.  It depends on whether you 
want a "live" simulation or a movie.

Bill


________________________________________
From: Bruce Vines [[email protected]]
Sent: Friday, November 26, 2010 1:40 PM
To: Schwab,Wilhelm K
Subject: RE: [Plplot-general] plplot and animation

What I want to do is create a ball that bounces off the walls of in which it's 
enclosed.  To produce the appearance of motion, I want to draw a circle, erase 
the circle, then redraw it in a new position along its travel path.  I've done 
this in Matlab.  I'm not terribly fond of Matlab and don't have access to it on 
my private machines.  I'm looking for an alternative graphics library to do 
this kind of simulation.  If plplot can do this sort of thing it would be 
terrific because I also have uses for it as a charting package.



--
Bruce





On Fri, 2010-11-26 at 09:48 -0500, Schwab,Wilhelm K wrote:


Are you trying to produce the animation, or do it in a particular way?  If the 
former, you might look at mencoder.  It can turn still images into .avi file.




________________________________________
From: Bruce Vines [[email protected]<mailto:[email protected]>]
Sent: Wednesday, November 24, 2010 3:54 PM
To: 
[email protected]<mailto:[email protected]>
Subject: [Plplot-general] plplot and animation

I'm trying to do a bouncing ball simulation and use plplot for the
graphics utility. Here's a simple piece of code I've been trying to get
to work:

open Plplot

let green = 3 ;;
let black = 0 ;;

let hide () =
    plcol0 black ;
    plarc 0.5 0.5 0.031 0.031 0.0 360.0 true

let show () =
    plcol0 green ;
    plarc 0.5 0.5 0.031 0.031 0.0 360.0 true

let wait secs =
    let t0 = Sys.time () in
    while ((Sys.time () -. t0)) < secs do
        print_string ""
    done ;;

let run () =
    plbop () ;
    plssub 1 1 ;
    plcol0 green ;
    pladv 1 ;
    plvpas 0.0 1.0 0.0 1.0 1.0 ;
    plwind 0.0 1.0 0.0 1.0 ;

    show () ;
    wait 1.0 ;

    hide () ;
    wait 1.0 ;

    show ()

let main () =
    plsdev "xcairo" ;
    plinit () ;

    run () ;

    plend () ;;

let () = main () ;;

While this is written in OCaml, it's close to what it would look like in
C. I'm trying to plot a green circle, wait for one second, plot a black
circle over the green circle (erase it), wait another second, and then
plot the green circle again. There are two problems I have with this
code:

1) If I remove everything in the run () function after the first show ()
function, this works exactly as I expect. I get a green circle in the
middle of the graphics screen. If I add the first wait (), then I don't
see the green circle until after the wait () has executed. Is there any
way to get the screen to update immediately after the show () function?

2) Is it possible to draw multiple times to the same sub-screen and if
so , can you point me in the right direction?

Thanks.

--
Bruce





------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Plplot-general mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/plplot-general



------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Plplot-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to