# Vector3 operation question

This topic is 4614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have 2 points: Vector3 vPos, vLookAt;
Vector3 vNewDir = Vector3.Subtract(vPos, vLookAt);


After these 2 operations, shouldn't vNewPos = vLookAt

##### Share on other sites
It might, depending on the order of the subtraction in Subtract(). But then you can always change the order of the parameters. Why don't you try it out?

No.

8 = 10 - 2
18 = 10 + 8

##### Share on other sites
I am missing something...

v = p2 - p1

Point direction form of a ray:
p2(t) = p1 + v(t)

when t = 1

p2 = p1 + v

p1 = 5, p2 = 2

v = 2 - 5

2 = 5 + -3

##### Share on other sites
ok .. i see it . my post was inconsistent with the code. please cut me some slack .. i am somewhat new to this :)

##### Share on other sites
Quote:
 Original post by pbergeronok .. i see it . my post was inconsistent with the code.

No worries. I figured it was something like that.

1. 1
Rutin
28
2. 2
3. 3
4. 4
5. 5

• 13
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009410
• ### Who's Online (See full list)

There are no registered users currently online

×