How can I change vector3d’s origin point from (0,0,0) to
other location?
On attached picture I have shown the reason why I need to do it,
normaly if I do
ActionScript Code:
[LEFT]...
[COLOR=#0000FF]private[/COLOR] [COLOR=#000000]var[/COLOR] v1:Vector3D = [COLOR=#000000]new[/COLOR] Vector3D[COLOR=#000000]([/COLOR][COLOR=#000080]40[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]private[/COLOR] [COLOR=#000000]var[/COLOR] v2:Vector3D = [COLOR=#000000]new[/COLOR] Vector3D[COLOR=#000000]([/COLOR][COLOR=#000080]20[/COLOR],-[COLOR=#000080]20[/COLOR], [COLOR=#000080]10[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]private[/COLOR] [COLOR=#000000]var[/COLOR] n1:Vector3D = [COLOR=#000000]new[/COLOR] Vector3DCOLOR=#000000[/COLOR];
[COLOR=#0000FF]public[/COLOR] [COLOR=#000000]function[/COLOR] vectorCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]
n1 = v1.[COLOR=#000080]crossProduct[/COLOR][COLOR=#000000]([/COLOR]v2[COLOR=#000000])[/COLOR];
n1.[COLOR=#000080]normalize[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
n1.[COLOR=#000080]negate[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
…
[/LEFT]
it works but only for the red arrow on the picture as it is calculating
vector directions from origin at (0,0,0),
I also need to calculate vector from different location for triangle
described by green spheres. To do that I need to be able to change
vector3D starting point.
How can I do it?