|
-
Nov 18th, 2004, 08:39 PM
#1
Point, add a distance in a vector direction....
I am tooo tired for this....Well lets say that I have a point:
1, 5, 20
and a LOOK direction vector that is:
250, 148, 120
And I want to add 600 to the point in THAT direction.....what am I supposed to do again...
PS:I hate to do math and 3D programming when I am drunk.....
Last edited by NoteMe; Nov 18th, 2004 at 08:49 PM.
-
Nov 18th, 2004, 08:47 PM
#2
Ex-Super Mod'rater
First off you need to work out how long the look vector is so we can normalise it:
LookLen = sqrt(250^2 + 148^2 + 120^2)
Lx = 250 / LookLen
Ly = 148 / LookLen
Lz = 120 / LookLen
Now we add the 600 using the normalised vector to distrubute the 600 ...
Nx = 1 + (Lx * 600)
Ny = 5 + (Ly * 600)
Nz = 20 + (Lz * 600)
New Position is (Nx, Ny, Nz)
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Nov 18th, 2004, 08:49 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|