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.
Page Index Toggle Pages: 1
Wired Metaballs (Read 2138 times)
Wired Metaballs
May 1st, 2005, 12:40am
 
Hello all,

I ported one of my applet called Wired Metaballs into OpenGL applet. I was curious on how fast it could be, as I had also done a version with c++/opengl. And well, the results are quite amazing, as it is running as smooth as the c++ one, visually speaking.
I've planned to make metaballs code available as a library, stay tuned .The ability to import library in such an easy way is one of the coolest feature of this new processing release. Reusability, yeah Smiley

Source folder is available here :
http://v3ga.net/processing/Metaballs3DApplet/Metaballs.zip

Screenshot here :
http://v3ga.net/processing/Metaballs3DApplet/Metaballs.jpg
Re: Wired Metaballs
Reply #1 - May 1st, 2005, 1:02am
 
super speedy.  Even works fine when the res is 36.  Lovely.  Now, texture map that SOB!!!  Tongue
Re: Wired Metaballs
Reply #2 - May 1st, 2005, 5:59am
 
Sweet! Setting the background color and the foreground color to the same thing with transparency, cranking the res up, and making the lines thicker looks pretty sweet.
Re: Wired Metaballs
Reply #3 - May 2nd, 2005, 2:02am
 
Okay, here we go with some env mapping!

Well, the thing is mostly done with gl commands , and do not know if this was the 'correct place' to post that here in a sense that it is not using Processing regular drawing commands, but uses a little 'tweak' to have access to opengl object instead. Anyway, here are some links (images + code).

Images:
http://v3ga.net/processing/Metaballs3DApplet/MetaballsEnvMapping01.jpg

http://v3ga.net/processing/Metaballs3DApplet/MetaballsEnvMapping02.jpg

Source:
http://v3ga.net/processing/Metaballs3DApplet/MetaballsEnvMapping.zip

Re: Wired Metaballs
Reply #4 - May 2nd, 2005, 8:13pm
 
Sweet!  So, would this be impossible to do using the processing drawing functions?  Secondly, what would I change to lose the blue tint on the texture image?

r
Re: Wired Metaballs
Reply #5 - May 3rd, 2005, 10:13am
 
Thanks !
I think that would be possible to use processing drawing functions but some more computations would be needed per vertex in order to compute texture coordinates. Here, they are directly generated by the video card. For the blue component, may be this could work (just before drawing triangles, didn't try it) :
opengl.glTexEnvf(GL.GL_TEXTURE_ENV,GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
opengl.glColor3f(a,b,c);
Instead of replacing pixels with raw textures values, it modulates them (a*Rtex,b*Gtex,c*Btex) ;  (a,b,c) ine the range (0,1).

Re: Wired Metaballs
Reply #6 - May 5th, 2005, 8:21pm
 
I don't know why, but when I download and play
this (in 87), the window comes up, there is
a reasonably sized display of the metaballs for
about 1/2 a second and then I get a rotating
mesh that is very small (maybe 50 pixels on a side
at the center of the window)...

Mobile ATI Radeon 9800 (the display card).
Re: Wired Metaballs
Reply #7 - May 6th, 2005, 1:04am
 
Hello,
is this the wired or mapped one which is buggy?
Anyway I've looked at the mapped one, there were some weirdos projection matrices setup, maybe this could be explain that. I've uploaded a new version with proper transformation :
http://v3ga.net/processing/Metaballs3DApplet/MetaballsEnvMapping.zip

Julien
Re: Wired Metaballs
Reply #8 - May 6th, 2005, 4:17am
 
Re: Wired Metaballs
Reply #9 - Jan 10th, 2006, 12:44am
 
v3ga wrote on May 1st, 2005, 12:40am:
I had also done a version with c++/opengl.


could you also post the source for the c++ version
(lines and environment mapping, if you've done env mapping in c++)
It runs really fast, nice job
Page Index Toggle Pages: 1