Results 1 to 7 of 7

Math Help - How to convert a 2d point into a 3d point ?

  1. #1
    Newbie
    Joined
    Apr 2005
    Posts
    4

    How to convert a 2d point into a 3d point ?

    To create 3d graphism i use a formula that convert a 3d point into a 2d point that i can draw on the screen.
    Now how can i do the inverse ? : convert a 2d point into a 3d point.

    Here is the formula :
    d and r are focal parameters.
    n and n1 are used to center the drawing on the form.
    (I use : d=2000, r=2000, n=400, n1=400)
    xe and ye are the coordinates and the result of the formula.
    x,y and z are the 3d coordinates of the point.
    d,r,n and n1 are known.

    b=y-z+r

    xe=(d*x)/b+n

    ye=n1-(d*y)/b

    Thanks.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Apr 2005
    Posts
    35
    From your formula, it looks like this might be the transformation from 3d to 2d,
    T(x,y,z) = ((d*x)/b+n , n1-(d*y)/b)
    Last edited by beepnoodle; April 18th 2005 at 07:47 PM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Apr 2005
    Posts
    4
    We can write this :

    z=(n1-ye)*b/d+r-b

    we have all the parameters on the right so we get z.

    In my sample we have xe,ye (the coordinate of the 2d point)
    xe=623 and ye=160

    n and n1 (parameter to center the drawing on the screen)
    n1=342 and n=442

    d and r the focal of the camera.
    d=2000 and r=2000

    we can rewrite this : z=(n1-ye)*b/d+r-b

    to get : b=

    I don't know how to reformulate this last line. Can you help me ?

    Thanks.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Apr 2005
    Posts
    1,631
    Okay, I will only show how to get or isolate the "b".
    I don't understand the whole solution as shown. The topic is beyond me.

    z=(n1-ye)*b/d+r-b

    If that is
    z = b(n1 -ye) / (d +r -b),
    then,

    Clear the fraction, multiply both sides by (d +r -b),
    z(d +r -b) = b(n1 -ye)
    z(d +r) -z(b) = b(n1 -ye)
    Collect the b-terms,
    z(d +r) = b(n1 -ye) +bz
    z(d +r) = b[(n1 -ye) +z]
    z(d +r) = b(n1 -ye +z)
    Divide both sides by (n1 -ye +z),
    b = z(d+r) / (n1 -ye +z) ....answer.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Apr 2005
    Posts
    4
    finaly i get this that works :

    z = (n1-ye) * (b/d) + r -b

    consequence : d(z-r) = (n1-ye)*b - d*b

    consequence : b = d(z-r) / (n1-ye-d)
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Apr 2005
    Posts
    1,631
    Umm, so it is actually
    z = (n1-ye) * (b/d) + r -b

    Then, yes, you are right,
    b = d(z-r) / (n1-ye-d)
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Apr 2005
    Posts
    4
    Thanks very much for your help.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 6
    Last Post: May 16th 2011, 05:57 AM
  2. Replies: 1
    Last Post: April 6th 2011, 07:44 AM
  3. Replies: 9
    Last Post: July 20th 2010, 09:00 AM
  4. Replies: 2
    Last Post: May 10th 2010, 09:39 AM
  5. Replies: 3
    Last Post: February 20th 2008, 11:17 AM

Search Tags


/mathhelpforum @mathhelpforum