To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 957
956  |  958
Subject: 
Re: LUBNET... hmmm.. now where could that lead us???
Newsgroups: 
lugnet.cad
Date: 
Tue, 16 Feb 1999 19:26:52 GMT
Viewed: 
912 times
  
LUBNET.. hmmm... (jeff ponders a moment, needing a break from processing
triangles into quads with edge lines and faces and determinants of 4x4
matrices to prove coplanarism of... aaaahhhhhhhhhhhhhhhh!!!!!)

Ah but you don't need to compute the determinant.

For 3D points A, B, C, and D represented as vectors, and AB is the line
segment from A to B (or B-A):
(AD x AB) . AC = det ( Ax, Ay, Az, 0,
                        Bx, By, Bz, 0,
                        Cx, Cy, Cz, 0,
                        Dx, Dy, Dz, 0)

Where x represents the cross product and . is the dot product and det is the
determinant.

I am not sure which is cheaper to calculate, but if you happen to have ADxAB
sitting around then you can do it this way.

I am writing a perl program that allows you to manipulate LDraw files and let
you examine it interactively.  At the moment it is displaying files in a
rudimentary way and rotating them.  Issues that I encountered was determining
if a quad was coplanar, and making sure that the quad was not "twisted" i.e.
the points were defined in either clockwise or counter clockwise order since
OpenGL has restrictions on that.

The major remainging problem that I need to address before this displays
perfectly is determining if a quad faces forward or backwards and changing the
ordering of the points in the quad so that the quad is shaded correctly and
backface culling can be done.  If anyone has any suggestions on this, please
let me know.

I should also clean up the interface so that the errors are detected and
corrected rather than just detecting the error and telling the user what it is
and making them fix the model file.  This requires automatically tesselating
quads into triangles where the quads are not planar.

Then of course I need to add the interaction to allow the user to control the
point of view rather than just simply rotating the model.

                    -ben



Message is in Reply To:
  LUBNET... hmmm.. now where could that lead us???
 
(...) LUBNET.. hmmm... (jeff ponders a moment, needing a break from processing triangles into quads with edge lines and faces and determinants of 4x4 matrices to prove coplanarism of... aaaahhh...hhh!!!!!) LUBNET... Lego User Badass Network??? (...) (26 years ago, 12-Feb-99, to lugnet.cad)

12 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR