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 & HelpPrograms › Increasing vertices of objects
Page Index Toggle Pages: 1
Increasing vertices of objects (Read 392 times)
Increasing vertices of objects
Mar 5th, 2006, 9:47pm
 
Hey all,
I am new to processing and programming general. so far I have done some simple work with it(move, push pops, and one class). I am trying now to do the following:

1-increase the number of vertices of an object from say (n) to (n*i)..
2-and link that mouse location.
I did not find a directly related syntax in the codes page. it might be there but I don't know of it as I am new to programming.
Any hints would be great.
Re: Increasing vertices of objects
Reply #1 - Mar 6th, 2006, 5:34am
 
It depends on what kind of "object" you're looking for.

If you're drawing bezier curves or catmull-rom curves you can easily shift the resolution "number of vertices" by changing the detail level at which it's drawn:

http://processing.org/reference/bezierDetail_.html
http://processing.org/reference/curveDetail_.html

Again, it's easier to do this if you've built this procedural object, or someone has written it and you're allowed to change its properties to increase or decrease vertices.

Example:
http://processing.org/reference/sphereDetail_.html
Re: Increasing vertices of objects
Reply #2 - Mar 7th, 2006, 4:06pm
 
greate, i will try these links.

here is what i got sp far:


import processing.opengl.*;
float sS;
float rS;
void setup()
{
size(400,400,OPENGL);
rS = random(.2,.3);

}

void draw()
{
 
 pushMatrix();
 translate(200,200);
 stroke(200,50,60);
 background(250);
 sS = rS+200;

int circleV = mouseX-200;

beginShape(LINE_LOOP);
for(int i=0; i<circleV; i++)
{
vertex(sS*cos((TWO_PI/circleV)*i), sS*sin((TWO_PI/circleV)*i));
rotateZ ((mouseY*frameCount)/20000);
}
endShape();
 
 popMatrix();
}


this increase the vertices as yu omove the mouse in X.
I am trying to control vertices.. i tried to String them, but i donlt know how to do that.,. is it beter to array them?. I want to be able to clcik stop these vertices to generate with a mouse click, then move them in relation to mouseX and mouseY.
Thanks
Page Index Toggle Pages: 1