computational form 23,
play 14,
information 13,
everybityoumake 12,
atoz 10,
processingtext 10,
mapping 9,
mobility 9,
nime 9,
fabricatinginformation 8,
interactivesound 7,
locative 7,
thesis 7,
ubicomp 5,
blah 4,
thinking 4,
isco 3,
pcomp 3,
assistive technologies 1,
howto 1,
visualization 1
CompForm Assignment 2 - Problem 5 · posted by vaibhav bhawsar Sep 21, 2007
Problem 5. Create a function called drawNecklace that draws a pearl necklace. Feel free to shade the pearls or make them sparkle in the light of the moving mouse.
void drawNecklace ( Vec2d c, float hr, float vr, int numberOfPoints )
{
for(int i = 0; i < numberOfPoints; i++)
{
float angle = 2*PI / numberOfPoints * i;
float x = sin(angle) * hr;
float y = cos(angle) * vr;
Vec2d p(x,y);
p = p+c;
drawCircle(p,20,20);
}
}
Comment
Commenting is closed for this article.
Previous: CompForm Assignment 2 - Problem 4 Next: Comform Assignment 2 - Problem 6




