Creating a 2D Line Branch (Part 2)

Posted by Danran on Game Development See other posts from Game Development or by Danran
Published on 2012-04-15T09:05:35Z Indexed on 2012/04/15 11:49 UTC
Read the original article Hit count: 269

Filed under:
|
|

Yesterday i asked this question on how to create a 2D line branch; Creating a 2D Line Branch

And thanks to the answered provided, i now have this nice looking main branch; *coloured to show the different segments in the final item. The 5th Generation Line (32 segments)

Now is the time now to branch things off as discussed in the article; http://drilian.com/2009/02/25/lightning-bolts/

Again however i am confused as to the meaning of the following pseudo code;

splitEnd = Rotate(direction, randomSmallAngle)*lengthScale + midPoint;

I'm unsure how to actually rotate this correctly. In all honesty i'm abit unsure what to-do completely at this part, "splitEnd" will be a Vector3, so whatever happens in the rotate function must then return some form of directional rotation which is then * by a scale to create length and then added to the midPoint.

I'm not sure. If someone could explain what i'm meant to be doing in this part that would be really grateful.

© Game Development or respective owner

Related posts about XNA

Related posts about c#