|
I have 3 values which I want to represent on a bar graph like display. The catch is I want the bars to come out rotated around a central point, to form a triangular shape. The values are variable, but the total is limited. Something like this. The values are a, b and c, along vectors o-e, o-g, o-f. My issue is the math behind it. I can follow the formula easy enough, but have yet to figure out how to apply it correctly in this instance. I'm trying to place point a at the correct distance, then rotate it by 120 degrees(circle/3) to get my three vectors. However, they all shoot off at random angles. I assume my problem is a) Not getting the direction vectors correct and b) not extending along these correctly. I've looked at wolfram, even the wolfire blog linked in another answer, but can't wrap my head around where I'm going wrong. Relevant code attached.
(comments are locked)
|
|
Unity has a convenient operator for rotating Vector's. Sorry it took so long to reply. The Point *= rotation; lines don't work, took me this long to get the google search right to find this thread: http://forum.unity3d.com/threads/36737-Vector3-rotation Worked once I changed "Point *= rot" to "Point = rot * Point". Otherwise perfect - ta muchly.
Apr 28 '11 at 06:19 PM
Chrisg
(comments are locked)
|
