Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

108 Neutral


  • Rank
  1. Could be gldepthfunc, try using GL_ALWAYS?
  2. Wow thanks,  never seen that before, any ideas for it's use? (The program being ported is used to create unfolded nets from 3D geometry.)   FYI, I think the normals are negated not the distance.
  3. Given the vertices for a poygon (tri or quad) , the face vertex list, and the normal for the polygon, a single floating point number is also given. Question is what does the value relate to?   example 1 v1   30.9, 234.51, -4.32 v2   -114.77, 117.93, 36.38 v3   52.97, 117.93, 145.31 normal   -0.390294  0.697474, 0.601 unknown value  -148.91   example 2 v1 -59.72, 163.79, 98.19 v2 -5.21, 177.91, 16.89 v3 10.44, 119.18, 88.13 normal   0.520179, 0.711538, 0.472364 unknown value   -131.862   We are porting a viewer to linux and mac, the unknown value isn't essential for the program, just wondering what it is.  
  4. Thanks guys, your fantastic.   Dot product method works to 0.1 degrees (floating point errors at 0.01 degrees).
  5. I have two polygons which share two vertices, and the normals for both polygons.   What I need to determine is whether the shared line between the polygons is a mountain or valley, ie the surfaces point away from each other or towards each other.   Finding the angle between the normals is easy:  angle = arccos(dotproduct(N1,N2)) I can't seem to find a simple solution to determine the sign of the angle. I have tried the atan2 method but this doesn't work, I keep getting an unsigned angle. There is also a method online (angle between two vectors) that requires the comparison between the cross product of two vectors and the original normal to the plane, but since there isn't a plane, the normal (to the normals) is calculated using the cross product, so only ever compares to itself.   I've tried a method of adding the normals to the centers of the polygons and measuring the distances between them, this works most of the time but fails when using acute angles.   Is there an equation that will give me the signed angle? or any other method that can determine if the line is a mountain or valley?   Thanks.    
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!