Results 1 to 4 of 4

Math Help - Calculating the Normal Vectors of a Pyramid in 3D Space

  1. #1
    Member
    Joined
    Jan 2011
    Posts
    156

    Calculating the Normal Vectors of a Pyramid in 3D Space

    I'm having trouble calculating the normal vectors for the four sides of a pyramid. Of course, a pyramid is just 4 separate triangles that share a set of 5 vertices. My four triangles sit at these coordinates:

    (0, 0, 0)
    (1, 0, 0)
    (0.5, 1, -0.5)

    (1, 0, 0)
    (1, 0, -1)
    (0.5, 1, -0.5)

    (1, 0, -1)
    (0, 0, -1)
    (0.5, 1, -0.5)

    (0, 0, -1)
    (0, 0, 0)
    (0.5, 1, -0.5)

    When I calculate the normals for each of these triangles, I get the following vectors (in the same order shown above):
    (0, 0.5, -1)
    (-1, 0.5, 0)
    (0, 0.5, 1)
    (1, 0.5, 0)

    This calculation is for a 3d computer application, but the lighting is clearly off, which tells me that I am getting the wrong answer. Can anyone help me out? Thank you!
    Last edited by joatmon; November 7th 2013 at 05:05 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Nov 2013
    From
    United States
    Posts
    7
    Thanks
    4

    Re: Calculating the Normal Vectors of a Pyramid in 3D Space

    Based on the definition of Cross Product, for the first triangle, I get
    (1,0,0) X (.5,1,-0.5) = (0,0.5,1)

    If I had to guess, I'd say you goofed somewhere in calculating the normals and as a result, some of them are pointing in instead of out (which will definitely screw up the lighting). Go back and check to see if you followed the right hand rule for calculating the normals.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Nov 2013
    From
    United States
    Posts
    7
    Thanks
    4

    Re: Calculating the Normal Vectors of a Pyramid in 3D Space

    Oh, another possibility is that the rendering software assigns the axis differently than the mathematical convention.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Dec 2012
    From
    Athens, OH, USA
    Posts
    643
    Thanks
    258

    Re: Calculating the Normal Vectors of a Pyramid in 3D Space

    Hi,
    You've found the hard problem of "outward pointing" normals. Given 3 points of a face, you know how to compute a normal n for the face. The only shading models that I know require the normal to point outward. So the normal you want is either n or -n. For some solids, including your square pyramid, the solution is easy.

    1. Assume the solid is convex, each face of the solid is also convex and the solid contains the origin as an interior point. The normal n is outward pointing iff the dot product of one vertex of the face with n is greater than 0.

    2. Assume the solid in question is a polyhedron. One possible test: n points outward iff the infinite ray drawn from a point of the face in direction n meets an even number (possibly 0) number of other faces of the polyhedron. Easy to state, but the details of implementation are significant, to say the least. For a drawing program that I wrote, I worked approximately 3 months to get everything right.

    3. For arbitrary solids, I'm clueless.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: May 6th 2012, 12:05 AM
  2. Replies: 6
    Last Post: October 20th 2011, 10:16 PM
  3. A normal Moore space is completely normal
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: March 19th 2011, 12:52 PM
  4. Replies: 1
    Last Post: February 24th 2011, 01:46 PM
  5. Replies: 0
    Last Post: February 21st 2011, 07:47 AM

Search Tags


/mathhelpforum @mathhelpforum