We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Mathsy graphics
Page Index Toggle Pages: 1
Mathsy graphics (Read 3422 times)
Mathsy graphics
Nov 2nd, 2005, 11:11pm
 
So I made a couple of Processing sketches today, fun little pretty things. They don't run as fast as I'd like, but I guess I could optimise them by using loadPixels etc. and perhaps using trig lookup tables. Might pre-defining an array of colours speed things up, too Any other suggestions would be welcome.

In any case, I thought it was a good start, and thought I'd share what I've made so far:

A warping membrane type thingy
and
An interactive, interacting-spirals doodad.
(edit: these are now quite well optimised)

Hope you enjoy them!

I have lots of old code knocking around, which I used to pre-render animations back in the days when PCs just weren't fast enough to do this sort of thing in real time, so I'm really going to have to hold myself back from spending too much time converting it all into Processing code when I should be doing other things...
Re: Mathsy graphics
Reply #1 - Nov 3rd, 2005, 3:35am
 
Hey, both those apps are really cool. I'm not quite sure what I'm looking at with the mebrane, but the crossing transparent fields work well.

I love the spirals, the drag action to zoom is a neat touch, works well. I especially like the way you can zoom out a long way and get some weird effects on the boundaries, like past the basic spiral Very cool.
Re: Mathsy graphics
Reply #2 - Nov 3rd, 2005, 11:20am
 
Yep, definitely loving the spirals.  The membrane one was a little dark for me, but it looked nice.

Yeah, if you're doing pixel stuff, it's better to use loadPixels(), mess with the pixels array and then do updatePixels().  The set and get functions check bounds on x and y so they're a bit slower.  Likewise, you might also have more luck packing your own colour values rather than using color(), because it respects colorMode() it's generic but not optimal for setting every pixel.

There's good some stuff from fjen about using bit shifts for packing colours on the old forum here: http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1099892081;start=1

Finally, if you're doing pixel based stuff you might have more luck switching to the P3D renderer - size(200,200,P3D) - it's not as reliable as the default renderer for drawing lines etc and it's not as fast as OpenGL in 3D, but it works in applets and it's a bit faster for pixels.

I double-dares you to port all your old code Smiley
Re: Mathsy graphics
Reply #3 - Nov 3rd, 2005, 2:47pm
 
I'll be porting all my old code that it seems sensible to port - which will surely include all the varieties of Poco animations I made, but I'm not sure yet whether or not it'll be worth also porting my existing Java applets. I probably will, I suspect, because various improvements are going to be easier - the trouble is just that they all have a bunch of parameters to play with, currently controlled by sliders, and it seems it's going to be a bit of a pain to re-do that interactivity Processing-style. On the other hand, they don't necessarily need to be so interactive, and I'm feeling bouncy about the possibility of making phone-friendly versions of them all using Mobile Processing (I wonder how well this'll work).

I'll definitely do Resonata, in any case, because that's what I'm supposed to be working on at the moment, and I like the look of the Ess library for sound input and output (which is currently high on my to-do list for Resonata).

Thanks a lot for your feedback and suggestions. I'll definitely try using loadPixels etc., pre-define my colours (which is fun anyway, and for which I can easily port code I have already) and have a look at P3D. OpenGL 3D stuff can come later, I think...!

I'm feeling more enthusiastic about programming than I have in years. Hooray!
Re: Mathsy graphics
Reply #4 - Nov 3rd, 2005, 3:06pm
 
Markavian wrote on Nov 3rd, 2005, 3:35am:
Hey, both those apps are really cool. I'm not quite sure what I'm looking at with the mebrane, but the crossing transparent fields work well.

I love the spirals, the drag action to zoom is a neat touch, works well. I especially like the way you can zoom out a long way and get some weird effects on the boundaries, like past the basic spiral Very cool.



Thanks Markavian. The membrane needs a little bit of work really - sensible colours and a bit of interactivity.

I've just spotted your GUI library, which straight away makes me feel much more positive about trying to port all my existing applets. Cheers!
Re: Mathsy graphics
Reply #5 - Nov 4th, 2005, 4:41pm
 
Very nice work. I particularly like the first one. Keep it up.
Re: Mathsy graphics
Reply #6 - Jan 24th, 2006, 11:28pm
 
I made another one - I'm calling it Rosaly, and it's sort of a cousin of Trochor. I think I might try converting it to Mobile Processing now...
Re: Mathsy graphics
Reply #7 - Jan 25th, 2006, 11:50pm
 
Got that version for mobile phones working! Hurrah. It's at http://www.mimeomai.f2s.com/applet/rosalymob/ if anyone's interested.
Re: Mathsy graphics on phones
Reply #8 - Jan 28th, 2006, 1:48am
 
There's now a shorter URL for the mobile version - oolong.notlong.com - and I've added a few more controls. The proper place for anything more about this would be the thread about it on the Mobile Processing board, though.

Cheers!

- f.
Re: Mathsy graphics
Reply #9 - Mar 8th, 2006, 9:04pm
 
If anyone is interested, having been spurred to it by wanting to add trails to my recent rope simulator thing I have added frame blending to Rosaly using this sort of technique:
Code:
  if (frameblending){
fill(0,16);
rect(0,0,width,height);
}
else background(0);

I'm really very pleased with the effect.

I've also added a Mobile Processing version of Resonata (a wave simulator type of thing) to http://oolong.notlong.com/ - I haven't uploaded my straight-Processing version of this yet, I'm not sure if it's worth it or not. Maybe if I add frame blending...!

(is it good form to announce this sort of thing here I confess to being a bit unsure of etiquette - I've also posted links in the Exhibition section...)
Re: Mathsy graphics
Reply #10 - Sep 21st, 2006, 5:18am
 
OMG! That frameblending trick is blowing my mind with it's simplicity! I'm working on a game with stuff that is supposed to ghost. I was keeping track of the past positions and using alpha to get the effect, but this accomplishes the exact same thing with *way* less work. Thank you!
Re: Mathsy graphics
Reply #11 - Oct 1st, 2006, 9:36pm
 
Heh! Glad it's working for you. It's really wonderfully simple eh? Smiley
Re: Mathsy graphics
Reply #12 - Oct 2nd, 2006, 8:20pm
 
I don't get it. When I tried to use the transparent fill method, it didn't work like it works with your app - since the color is just multiplied by something like (1-16/256), the trail never really fades. Same with blend() and blendColor().
Are you using an older version or something?

Also I'm having trouble when I need multiple things with various effects on screen, there should be something more than just PImage (with alpha, that is).
Re: Mathsy graphics
Reply #13 - Oct 5th, 2006, 7:03pm
 
What effect are you getting when you try to do the frame-blending trick? Have you tried running the code for Rosaly on your installation of Processing? It wasn't a particularly old version I used to make it, but it wasn't the latest either.

Not sure I follow you in your last paragraph...?
Re: Mathsy graphics
Reply #14 - Oct 5th, 2006, 7:59pm
 
I got a higher version now so I'm cool with PGraphics and all (I'm more of a ActionScript guy, so I wasn't comfortable with the lack of graphic instances).

As for the frameblend, I just figured out that it does work for a dark background (I was mostly using white/bright), seeing that colors are used like 'color - 256' (all negative) in Java, making black the largest value.
Page Index Toggle Pages: 1