Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7982261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:37:42+00:00 2026-06-04T10:37:42+00:00

I have 2 triangles and vertices p0, p1, p2, p3. These two triangle share

  • 0

I have 2 triangles and vertices p0, p1, p2, p3. These two triangle share an edge. From these two triangle I want to make a tetrahedron given by the 4 vertices. The library which I work with requires that “the 4 vertices should be given such that the four vertex triples defining the tetrahedron faces in the drawing appear in counter-clockwise order when being viewed at from the outside” drawing . Assuming one of the two triangles is p0, p1, p2 I calculate the normal as being (p1-p0) (cross) (p2-p0). Can someone please tell me a way to ensure that this condition is met ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:37:44+00:00Added an answer on June 4, 2026 at 10:37 am

    Short answer:

    The condition is that p3 must be on the correct side of the plane determined by (p0, p1, p2).

    So, after computing the normal for this plane, you need to determine if the vector from (say) p0 to p3 is pointing in the same direction of the normal, or the opposite direction, by taking the dot product dot(normal, p3-p0).


    More mathematically speaking:

    You need to find the determinant of the 4×4 matrix formed by the homogeneous coordinates of the four points. The sign of the determinant determines if the condition is met; the appropriate sign depends on the exact conventions used, but ideally it should be positive:

    require:
      0 < det(p0, p1, p2, p3)
    
      == det [ p0.x p0.y p0.z 1 ]
             [ p1.x p1.y p1.z 1 ]
             [ p2.x p2.y p2.z 1 ]
             [ p3.x p3.y p3.z 1 ]
    

    If a particular ordered set of points has a negative determinant, you can fix it by swapping any two of the points (which will negate the determinant):

    e.g., swapping p0 and p2:
    
    det(p0, p1, p2, p3) = - det(p2, p1, p0, p3)
         ^       ^               ^       ^
    

    or, more generally, switching between even and odd permutations of the four vertices.

    If the determinant is zero, the four points are co-planar, and cannot be fixed like this.


    Finally, the code:

    A relatively simple way to compute this determinant with 3-d vector math:

    let:  v1 = p1 - p0
          v2 = p2 - p0
          v3 = p3 - p0
          norm12 = cross(v1, v2)
       -> determinant = dot(norm12, v3)
    

    The final determinant is also known as the “triple product” of v1, v2, and v3.

    Note that I have hesitated to try to decode the exact sign convention (i.e., whether you need the determinant to be positive or negative) from your question: the wording and diagram you supply is more than a bit confusing.

    Since you have the original library and its documentation, though, you are in the best position to answer this question. As a last resort, you can try the empirical method: try both signs, and pick the one that doesn’t blow up…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a square from (0,0) to (z,z). Given a triangle within this
I have a triangle in 3D space defined by its 3 vertices, p0, p1,
Is there a Java graphics library that will rasterize a triangle given the coordinates
Given vertices V1 (x1,y1,z1) , V2 (x2,y2,z2) , V3 (x3,y3,z3) of a triangle T,
I have created a Vertex Buffer Object containing only vertices for triangles, for drawing
I have a set of textures which I need to draw at different vertices
I would like to have a gradient background in OpenGL I found these two
I have vertices and an edge list that describe a planar geometric shape (faces
I have data from *.obj file. I know how draw with GL_TRIANGLES . How
I have a triangle in (u,v) coordinates in an image. I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.