# Vector3D's origin point change

**URL:** <https://forum.kirupa.com/t/vector3ds-origin-point-change/298490>\
**Category:** flash\
**Created:** [October 20, 2009, 1:52am UTC](https://forum.kirupa.com/t/vector3ds-origin-point-change/298490 "2009-10-20T01:52:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![renton79](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@renton79](https://forum.kirupa.com/u/renton79)\
**Post date:** [October 20, 2009, 1:52am UTC](https://forum.kirupa.com/t/vector3ds-origin-point-change/298490/1 "2009-10-20T01:52:23Z")

</div>

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),

![](http://lh5.ggpht.com/_-cEB3ZRvEQ8/St0XQ8lgHqI/AAAAAAAAAIk/7YvtsXHK_CY/exmp.png)

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?
