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.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › drawing and rotating problem
Page Index Toggle Pages: 1
drawing and rotating problem (Read 866 times)
drawing and rotating problem
Jan 9th, 2006, 2:55pm
 
Hello,

I am designing an application and I want in the same time draw a 3D line, feeded via OSC (that I can do it, coming from a wacom with x, y and z being presure), and during the same time be able to rotate the draw. But the "pushmatrix/popmatrix" syntax, need to redraw the screen ("background (0)") and I lost the precedent draw.
Perhaps can I use a little time between distant draw and redraw with 3D view, so processing can count the number of point for the line but even doing that, how to dynamicly write the line?
I finish a little bit the proto before to send it on line but perhaps could you suggest me a solution?

Thank you
Re: drawing and rotating problem
Reply #1 - Jan 10th, 2006, 5:53pm
 
Hi jhoepffner,

If you want to keep the precedent draw, just remove background();. Many people use it as a fade effect (they put a transparent mask in front of the whole scene). Here's an example:

Code:

void setup(){
size(600,300,P3D);
noStroke();
}

void draw()
{
fill(255,10);
rect(0,0,width,height);

fill(255,100,100,50);
pushMatrix();
translate(width/2,height/2);
rotateX(frameCount/100f);
rotateZ(frameCount/10f);
rect(-125,-125,125,125);
popMatrix();
}


If you need to calculate transformation on points, you could use vector class as Vec3D (http://processing.unlekker.net/Vec3D.html - Marius Version). You could collect any points in arrays.

For the tablet, I wrote some sketches for handmade drawings. I used MIDI instead of OSC. It was done to use the tablet a VJ|Music controller. http://spacekit.ca/news/news/spacekit/161. It was fluid on any VST synths. It was fullscreen in openGL. Tell if you question on this.

You could have also a look for jMusic for midi.
Re: drawing and rotating problem
Reply #2 - Jan 11th, 2006, 10:53pm
 
Thank you for the answer, I will "digest" the information and I will post actual code
Page Index Toggle Pages: 1