svdl opened this issue on Jan 13, 2006 ยท 19 posts
svdl posted Fri, 13 January 2006 at 11:34 PM
By taking the dot product of this normalized vector - which actually represents the vector pointing from the eco'ed object towards the "center object" - with the vector (-1,0,0) - that represents the default zero orientation for ecosystems - I get the cosine of the orientation angle.
Taking the arc cosine will give me the angle in radians, which then has to be mapped from the 0..3.1416 range to the 0..1 range.
Unfortunately, the arc cosine function only represents HALF a circle. The other half must be obtained by determining the relative y position - is the eco object in front of the center object, or is it at the back? If it's in front, we can keep the angle that the arc cosine function has calculated, if it's in the back, we'll have to take the opposite of the calculated angle.
That is what the right hand side of the graph is accomplishing. By taking the dot product of the normalized vector with (0,1,0) (alright, a Decomposer 3 using the Y component would achieve the same thing), I get the relative Y position.
Message edited on: 01/13/2006 23:37
The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter