Forums > MaxMSP

Smoother 2D animation

March 17, 2006 | 1:34 am

Hi,
I am doing some basic 2d animation with jitter, but would like the
pixel to pixel movement to be fairly time accurate. Matt Wright helped
me come up with this great phasor based animator that I was using with
LCD and now jitter, however the animation is not very smooth. I
thought this was due to the limitations in LCD but now that I’m doing
it in jitter I’m not sure what is wrong. Could someone look at the
below patch and see if there is any way to make the animation smoother
while maintaining it’s time accuracy?
Thanks,
Justin

BTW – Thanks to the community for all the recent help. It has been of
great benefit.

max v2;
#N vpatcher 3 44 1273 888;
#P origin 6 33;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 572 620 243 1441802 jit.gl.sketch sketchy @smooth_shading 1;
#B color 5;
#P flonum 625 500 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 572 500 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 572 521 63 1441802 pak 0. 0.;
#P window linecount 5;
#P message 572 547 363 1441802 reset , glmatrixmode modelview ,
glpushmatrix , gltranslate $1 $2 , glbegin tri_strip , glcolor 1 0
0 1 , glvertex -0.5 -0.5 , glcolor 0 1 0 1 , glvertex -0.5 0.5 ,
glcolor 0 0 1 1 , glvertex 0.5 -0.5 , glcolor 1 1 1 1 , glvertex 0.5
0.5 , glend , glpopmatrix;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 675 383 34 196617 * -1.;
#P window setfont "Myriad Roman" 12.;
#P flonum 711 421 42 12 0 0 32 4019 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 764 328 42 12 0 0 32 4019 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 714 329 42 12 0 0 32 4019 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 680 356 98 196617 zmap 0. 1. -1.6 1.6;
#P user number~ 628 263 711 278 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221
221 222 222 222 0 0 0;
#P flonum 802 312 77 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 579 325 623 358 0;
#P comment 932 233 170 196617 How often is cursor redrawn (ms)?;
#P number 878 232 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 805 254 70 196617 snapshot~ 50;
#P newex 805 276 47 196617 * 1000.;
#P window linecount 3;
#P comment 796 108 73 196617 set time (ms) for one voyage across screen;
#P number 804 144 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 804 165 49 196617 !/ 1000.;
#P flonum 804 202 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 799 186 86 196617 or set Frequency;
#P newex 804 232 46 196617 phasor~;
#P window setfont Times 10.;
#P window linecount 2;
#P comment 6 466 239 1310730 For more info about OpenGL , please
consult opengl.org. A link to the useful and informative "Redbook" is
below.;
#P window linecount 1;
#P comment 26 35 40 1310730 Display;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 6 160 53 1441802 loadbang;
#P window linecount 2;
#P message 6 496 411 1441802 ; max launchbrowser
http://www.opengl.org/documentation/red_book_1.0/;
#P window linecount 1;
#P message 6 185 81 1441802 name sketchy;
#P user jit.pwindow 5 210 322 242 0 1 0 0 1 0;
#X name sketchy;
#P toggle 6 35 15 0;
#P newex 6 126 283 1441802 jit.gl.render sketchy @erase_color 0. 0. 0.
1.;
#P newex 6 86 63 1441802 t b erase;
#P newex 6 58 63 1441802 qmetro 33;
#P user panel 0 151 431 385;
#X brgb 127 255 127;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P user panel 0 24 424 134;
#X brgb 255 127 127;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P connect 5 0 2 0;
#P connect 2 0 3 0;
#P fasten 3 1 4 0 64 115 11 115;
#P connect 3 0 4 0;
#P connect 9 0 7 0;
#P connect 7 0 6 0;
#P connect 28 0 32 0;
#P connect 32 0 31 0;
#P connect 31 0 30 0;
#P connect 30 0 34 0;
#P connect 33 0 31 1;
#P connect 12 0 24 0;
#P connect 25 0 29 0;
#P connect 19 0 25 0;
#P connect 29 0 28 0;
#P connect 26 0 25 3;
#P connect 27 0 25 4;
#P connect 18 0 23 0;
#P connect 16 0 15 0;
#P connect 15 0 14 0;
#P connect 14 0 12 0;
#P connect 12 0 19 0;
#P connect 19 0 18 0;
#P connect 20 0 19 1;
#P pop;


March 18, 2006 | 1:31 am

By what do you mean smooth, just tried the patch out on my Ibook G4 1.48Ghz.The movement on the screen is constant and the edges are sharp. What is it you wish to acomplish as far as making it smoother.
You could probably create some kind of blur effect using open GL would be my only immidiate idea?
Tristram


March 19, 2006 | 7:54 am

I have a powerbook G4 1.5ghz and whenever I animate an object this way
there are several problems: one is that the edges are a bit fuzzy they
have a sort of blur it is subtle but it is there. Second is every
couple of seconds the object will jerk a little bit like there is some
other task with priority and it is waiting but nothing else is running.
Yet when I use a simple line object everything is smooth. Maybe there
is another way of getting signal rate accuracy while maintaining
smoothness. BTW I have the qmetro attached to the jit.render object
set to 1 and the snapshot object connected to the phasor set to 1.
Maybe some sort of aliasing. Thanks for your input.


Viewing 3 posts - 1 through 3 (of 3 total)