• 13
• 18
• 19
• 27
• 10

Vector3 operation question

This topic is 4400 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.