Results 1 to 5 of 5

Math Help - Help with vertex's in a 3d space

  1. #1
    Senior Member
    Joined
    Sep 2009
    Posts
    299

    Exclamation Help with vertex's in a 3d space

    I am making a 3d editing program and I need help with vertex points.

    In a grid like this


    given a point say (-20,-30,50), how would I get the new point if that point were to be rotated say 50 degrees along the y axis plane?

    so the y plane would look like a vertical wall in the center of the grid. (so you know, its the y plane)

    I figure if I had a 3d model and knew all its vertex's, then edited them all, and viewed the new model, the whole model would be rotated 50 degrees along the y plane.


    thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,623
    Thanks
    428

    Re: Help with vertex's in a 3d space

    y-plane? there are an infinite number of planes that contain the y-axis. using your sketch, the vertical plane that contains the y-axis would be the y-z plane.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Sep 2009
    Posts
    299

    Re: Help with vertex's in a 3d space

    Yeah but I think I see what you mean.
    Here is a new picture. This is what you mean by y-z plane?

    Anyways I figure I have to use something like this:
    Code:
    for i=1 to nrpoint
    
    ;or what ever :)
    x#=x_ponit(i)
    y#=y_ponit(i)
    z#=z_ponit(i)
    
    ; rotate x-axis
    x1#=x#
    y1#=(cos(ang)*y#)+(sin(ang)*z#)
    z1#=(sin(ang)*z#)-(cos(ang)*y#)
    
    ;roate y-axis
    x2#=(cos(ang)*x1#)+(sin(ang)*z1#)
    y2#=y1#
    z2#=(sin(ang)*z1#)-(cos(ang)*x1#)
    
    ;rotate z-axis
    x1#=(cos(ang)*x2#)+(sin(ang)*y2#)
    y1#=(cos(ang)*y2#)+(sin(ang)*x2#)
    z1#=z2#
    
    x_ponit(i)=x1#
    y_ponit(i)=y1#
    z_ponit(i)=z1#
    
    next
    Attached Thumbnails Attached Thumbnails Help with vertex's in a 3d space-axis.jpg  
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,569
    Thanks
    1410

    Re: Help with vertex's in a 3d space

    If you mean "rotate around the y-[b]axis[b]", not "y-axis plane", then any rotation about the y-axis, through angle [itex]\theta[/tex] changes (x, y, z) into (x', y', z') given by
    \begin{bmatrix}x' \\ y' \\ z'\end{bmatrix}= \begin{bmatrix}cos(\theta) & 0 & -sin(\theta) \\ 0 & 1 & 0 \\ sin(\theta) & 0 & cos(\theta)\end{bmatrix}\begin{bmatrix}x \\ y \\ z\end{bmatrix}
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member
    Joined
    Sep 2009
    Posts
    299

    Re: Help with vertex's in a 3d space

    hmm ok but how do I compute that, can you write each one out as a line rather than as a matrix, and also what are the matrix's for rotating around the x-axis and z-axis?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Question on null space/column space/row space of a matrix
    Posted in the Advanced Algebra Forum
    Replies: 5
    Last Post: December 1st 2011, 01:47 PM
  2. Replies: 2
    Last Post: July 8th 2011, 02:16 PM
  3. Replies: 1
    Last Post: January 30th 2011, 07:18 AM
  4. Replies: 15
    Last Post: July 23rd 2010, 11:46 AM
  5. Replies: 2
    Last Post: June 9th 2010, 07:39 AM

Search Tags


/mathhelpforum @mathhelpforum