A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to detect the point of intersection of a Line and a Triangle (3D)

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    77

    Arrow How to detect the point of intersection of a Line and a Triangle (3D)

    There is some information but I couldn't figure it out: http://softsurfer.com/Archive/algori...gment-Triangle

    How can I detect if a line intersects with a triangle ? And how can I detect the point of intersection in AS3 ?
    Last edited by mastermax; 11-28-2010 at 11:16 AM.

  2. #2
    Bacon-wrapped closures Nialsh's Avatar
    Join Date
    Dec 2003
    Location
    Houston!
    Posts
    338
    That site looks like it gives a pretty thorough explanation of what needs to be done.

    I assume you're trying to implement a function like this
    Code:
    import flash.geom.Vector3D;
    
    function intersectTriangleLineSegment(Vector3D V0, Vector3D V1, Vector3D V2, Vector3D P0, Vector3D P1) : Vector3D
    {
    	var u = V1.subtract(V0);
    	var v = V2.subtract(V0);
    	var n = u.crossProduct(v);
    
    	// ....more stuff goes here
    
    	return null;
    }
    What part is giving you trouble?

  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    77
    I solved my problem with an other technique. But your post may help others who google search this technique.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center