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 & HelpSyntax Questions › newb shiffman book question
Page Index Toggle Pages: 1
newb shiffman book question (Read 391 times)
newb shiffman book question
Feb 22nd, 2009, 8:05pm
 
in shiffman's book, learning processing

http://books.google.com/books?id=yrR1YoiM2EAC&pg=PA274&lpg=PA274&dq=shiffman+exercise+15-12+triangles&source=bl&ots=8bS7JkvLh2&sig=r3Uen9HDSshLh6bcNWdgbqkXrO0&hl=en&ei=8J-hScmKA4mMsAP235HFCQ&sa=X&oi=book_result&resnum=10&ct=result

there is an exercise not covered on the site (15-12)

i understand sampling pixels color values, and this example would be a piece of cake with squares or overlapping shapes

i am just stuck how to make triangles pattern out alternating up and then down.

in the library it seems like the triangle primitive needs 3 sets of coordinates

Re: newb shiffman book question
Reply #1 - Feb 23rd, 2009, 3:45pm
 
> in the library it seems like the triangle primitive needs 3 sets of coordinates

is that really surprising? 8)

i'd write a method that drew an equilateral triangle of a given size and colour at the passed-in centre co-ordinate and then it's just a case of rotate(PI) before every other call to flip it on its head.

(your centres will have to be spaced differently in the x and y axis i think (am guessing .866 will play a role here))
Re: newb shiffman book question
Reply #2 - Feb 23rd, 2009, 9:25pm
 
thanks

i need to strengthen the muscle that breaks things down into classes and methods!

will see how it goes.  that helps a lot though
Page Index Toggle Pages: 1