Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to get such a vector in 3D space

Discussion in 'Scripting' started by live_xi, Nov 25, 2015.

  1. live_xi

    live_xi

    Joined:
    Oct 21, 2015
    Posts:
    12
    Hi Folks,
    in 3D world space we have a point/vector w (position) + orientation (roation).
    How can i get such a vector v that fills the following conditions
    1. vector (w - v) has the same orientation
    2. distance between w and v ist d, or norm of vector (w - v) is d.
    I know how to calculate in 2D but have difficulty in 3D space.
    Please help me, thanks
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,735
    I'm a little puzzled by this one, as vectors do not have an orientation. Do you mean you want it in the direction of "forward" based on the orientation?
     
  3. live_xi

    live_xi

    Joined:
    Oct 21, 2015
    Posts:
    12
    hi manta i meant an euler angle/quaternion by orientation/rotation.
    i know how to solve this problem under 2D space. but what's the common method under 3D.
     
  4. live_xi

    live_xi

    Joined:
    Oct 21, 2015
    Posts:
    12
    HI I upload an image to describe this problem in 2D. but i need a solution in 3D space
     

    Attached Files:

    • ddd.jpg
      ddd.jpg
      File size:
      37.1 KB
      Views:
      691