Drawing object on the intersections point of 2 lines.

hi guys, im very new in actionscrip , please give me some guidance.
i'm doing this project , about 2 lines intersecting each other(the 2 lines are not always on the same position) . i try to find the intersections point using collision detection method but how do i place an object on the intersections point?
if(line1.hitTestObject(line2)) //  so this is how we find the intersection point but we do not know how to draw/place an object on the  intersection point.

then it's easier to calculate the intersection algebraically:
function intersectionF(x1:Number,y1:Number,x2:Number,y2:Number,x3:Number,y3:Number,x4:Number,y4:Number):Array {
     if (x1==x2) {
          if (x3==x4) {
               if (x1==x3) {
                    return ["line1"];
               } else {
                    return [null];
          } else {
               // line 1 vert, line 2 not
               var m2:Number = (y3-y4)/(x3-x4);
               var b2:Number = y3-m2*x3;
               return [x1,m2*x1+b2];
     } else {
          // line 1 not vert
          if(x3==x4){
               // line 2 vert
               var m1:Number = (y1-y2)/(x1-x2);
               var b1:Number = y1-m1*x1;
               return [x3,m1*x3+b1];
          } else {
               // line 2 not vert
               m1 = (y1-y2)/(x1-x2);
               b1 = y1-m1*x1;
               m2 = (y3-y4)/(x3-x4);
               b2 = y3-m2*x3;
               var x:Number = (b2-b1)/(m1-m2);
               return [x,m1*x+b1];

Similar Messages

  • The intersection point of two lines in 3D

    How to calculate the intersection point of two lines in 3D?
    source code!

    this is actually a rather easy operation. lets look at some basic properties of lines / vectors in 3D space:
    1. If two lines intersect at a single point, then there must be exactly one plane in which the two lines are co-planar. This is pretty trivial to prove, but I won't bother here, because you can google to find out that two vectors that extend from a common point define a single plane.
    2. If you take the cross-product of two vectors, the resulting vector is guaranteed to be perpendicular to both lines (this is a basic property of a cross-product). If the two lines intersect, then this cross-product will be the normal vector to the plane in which both lines lie.
    3. Now transform (rotate) yours space such that your z-axis becomes parallel to the normal vector of that plane.
    Now, the parametric equation for a line in 3D space is this:
    (x, y, z) = (xo, yo, zo) + k(xd, yd, zd)
    After you have transformed your space, you will notice that the equation of each line will now be
    (x, y, z) = (xo, yo, zo) + k(xd, yd, 0)
    If zo is equal for both lines, then the two lines intersect. Otherwise, the two lines do not intersect.
    if the intersection exists, then to solve for it, you ignore the z coordinate, and treat it like a two dimensional system:
    (x, y) = (xo, yo) + k(xd, yd)
    you can use the basic 2D formula y - yo = m(x - xo), or y = m(x - xo) + yo
    you can calculate m = yd / xd.
    which simplifies to y = mx -mxo + yo, or 0 = mx - y + (yo - mxo)
    you now have two equations of the form Ax + By + C = 0.
    From there, you can use Cramer's rule to find the intersection of the two lines.
    It sounds kind of complicated when you read it as I have presented it, but it's actually extremely easy to write a program for, because each step is simple mathematic operation with basically no decisions involved (hence no if-structures, except at the one point where you actually need to determine if the lines intersect).
    So to reiterate, the steps required are:
    1. Check if lines are parallel. If yes, check if they are the same line, and then stop.
    2. If not parallel, cross-multiply the direction vectors of each line.
    3. Rotate your space such that z is parallel with cross-product of lines
    i. dot-product of z axis (0, 0, 1) with cross-product of lines gives angle*
    ii. cross-product of z axis (0, 0, 1) with cross-product of lines gives axis of rotation.
    iii. rotate your lines (i.e. point and direction vector) about that axis by negative of ange determined in (i).
    4. if z value of points from both lines is the different, no solution. stop.
    5. otherwise, apply Cramer's rule.
    6. done.
    * obtaining the angle of rotation with the dot product relies on the angle being less than 90 degrees, so check if z value of normal vector is + or -, and then perform dot product and cross-product on appropriate + or - z vector.
    - Adam

  • Authorisation object to the loading point

    Hi, Experts,
          As per the requirement we have configured the Weigh Bridges as loading points  from where the TRUCK empty and Gross weights  can be taken to create the delivery and these loading points were  assigned to multiple shipping points. Again each Shipping point also assigned to multiple loading points.each weigh bridge i.e. the loading point is being operated  by the end user.As the shipping point is assigned to multiple loading points, system  is allowing the user to select any one  of the  loading point assigned to that shipping point.
        Now, my requirement is to restrict the end user to operate one loading point only by providing authorisation object for that loading point. what is the authorisation object for the loading point.
    Regards
    Sam

    the loading point is being operated  by the end user
    Through which transaction code, users are executing this loading point.  I think, the authorization object for this is L_YRD_MTHD
    G. Lakshmipathi

  • Problems finding the interception point of two lines

    Hi there,
    I've written a class "Linie", which extends the Line2D.Float class, and added a method to determine the interception point of two lines.
    One of the two lines can be anything except horizontal and vertical, the other one (which is the one that is passed to the method) can only be horizontal or vertical (I hoped this would make it easier).
    public Point schneidet(Linie l){
              Point schnitt = new Point();
              float m = (y1-y2)/(x1-x2);
              int n = Math.round(y1-(x1*m));
              if (l.y1==l.y2){               // Is line l horizontal?
                   int poX = Math.round((l.y1-n)/m);
                   schnitt.setLocation(poX,(int)l.y1);
              else if (l.x1==l.x2){               // Is line l vertical?
                   int poY = Math.round((m*l.x1)+n);
                   schnitt.setLocation((int)l.x1,poY);
              return schnitt;
         }The equation of a line is
    y = m*x + n.
    Because the line l can only be horizontal or vertical, one coordinate of the interception point is always clear from the beginning, the other one is supposed to be calculated and stored in poX or poY.
    But this is where the method doesn't do what it's supposed to. There must be some mistake inside the calculation with the slope (m) and n. Any ideas?

    Why so complicated? Are the lines real lines (straight connections between 2 points) or curves? If they are lines, you just need to inspect the coordinates of all 4 points (2 * 2 end points) and show if the points are "within" the other points ...
    Intersection point of two lines
    Line Intersection and its Applications
    SIMPLE ALGORITHMS I - INTERSECTION OF LINES

  • How to always rotate objects around the same point, even using the right-click menu?

    I need some of my objects to always rotate around the same point. How can I select a point which will stay that way?
    Using the rotate tool resets after deselecting.
    Also, I'd like to rotate objects around a certain point even when using the right click > Transform > Rotate.
    Is it possible?

    Right, so this is where Illustrator falls short with respect you your need, but only in the sense that the reference point can't be made to stick. You can, however, use Smart Guides to make it so the point is easy to set at exactly the same location, (especially since your object has an anchor point there), manually before each rotation.

  • Determine the Intersection points of 2 splines

    I have 2 sets of x,y points, from which I have created 2 splines. These lines intersect each other at a number of points. How can I determine these intersection points? As there are over 200 pairs of lines, each whose intersection points have to be calculated, I require a solution that executes very quickly.
    Thanks,
    Shaps

    You'll have to take a look at Solving Polynomial Equations.
    If you're not mathematically inclined, you might want to find help on this one. Otherwise, I'd start with Mathworld. It's a great site for Maths and Physics questions.
    The higher the order of your polynomial, the harder it is to solve.
    You should consider a more brute-force approach if you don't need high precision. It depends on your application, but here I cannot offer advice.
    Let's say you take the following approximations for your curves: (3rd order curves, very small chance of being perfect fit...)
    1) ax^3+bx^2+cx+d = 0
    2) a'x^3+b'x^2+c'x+d' = 0
    The curves cross each other for each x that satisfy this equation: 
    (a-a')x^3+(b-b')x^2+(c-c')x+(d-d') = 0
    Now, the analytical solution to this can be taken from Wolfram Mathworld website and is not too complicated, but to solve for a 7th order curve... good luck!
    All solutions will not necessarily fall within your data range, but if you want an approximative order for your equation, count the number of times each curve cross... and add a few orders!
    As I said, it might need a brute-force approach. Good Luck.

  • Set reference point for multiple objects in the middle of the document

    Hello Community,
    I want to mirror a layout.
    So I:
    1. Select all the objekts
    2. Set the reference point to the middle
    3. Mirror the objects
    BUT
    The reference point is the middle of all the OBJECTS. That leads to several objects crossing the border of my document because the layout isn't spread out evenly.
    I want to middle of the DOCUMENT to be the reference point. How can I do that?
    Thanks
    Christian

    Have you fiugured this out on your own?
    I just played around a bit and found a method, but it's not exactly intuitive. Select the object(s), then switch to the Rotate tool. The center of rotation will be defined as one of the transformation handles, but you can drag it to anywhere you like, so move it to the point that you want as the center of your mirror. Hold down the Alt/Opt key, and click the reflect button to make a mirrored copy. Without the modifier key the original objects will mirror their position around the repositioned reference.

  • Copy Multi-Layered Drawing-Object and keep the same Layers

    Good evening
    We often have to clone a Drawing-Object and the clone should use the same Layers. We expected that we can just select the Objects on the related Layers, Drag and keep a key (e.g. Ctrl) and Drop the copy
    An example:
    The original Object has an rectangle and a text on two layers:
    Layer 1: Rectangle (Original)
    Layer 2: Text (Original)
    After cloning, we should have:
    Layer 1: Rectangle (Original) Rectangle (Copy)
    Layer 2: Text (Original) Text (Copy)
    Thanks a lot for all ideas in advance,
    kind regards,
    Thomas

    Thank you for your fast answer!, unfortunately it does not work as expected: after the Copy-Operation I always have more Layers than before. To use my example again:
    The original Object has an rectangle and a text on two layers:
    Layer 1: Rectangle (Original)
    Layer 2: Text (Original)
    Then I select the Rectangle and the Text an copy these Objects.
    I always get:
    Layer 1: Rectangle (Original)
    Layer 2: Text (Original)
    Layer 3: Rectangle (Copy)
    Layer 4: Text (Copy)
    What I expect after copy is:
    Layer 1: Rectangle (Original) Rectangle (Copy)
    Layer 2: Text (Original) Text (Copy)
    Kind regards,
    Thomas

  • How can the coordinates of an intersection point of a cross

    there is a cross on a chart and i need the coordinates of the intersection point as a reference for further measurements

    The simplest way is pattern matching. Train the routine with the cross, then search for it. It should always be within about 1 pixel of the intersection. You can use sub-pixel accuracy to improve the results sometimes.
    To improve the pattern matching results, you can use edge or peak finding routines to find the horizontal and vertical lines that make up the cross. You can determine the center from these lines.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • How to find intersection point between a lineseries and a vertical line.

    I have a lineseries chart (refer the screenshot). As I move the spend slider shown in the attachment, a vertical line is drawn in the chart. (I did this using the cartesian canvas as annotation element - using canvas.moveTo(), canvas.lineTo() functions)
    I want to find out the intersection point(y value) where the vertical line meets the lineseries. Can someone help me on this. It will be really helpful.
    Thanks,
    Jayakrishnan

    Here are a few functions I wrote years ago for common chart transformations... the function you're going to focus on for your solution is chartToScreen...
    *  Converts the screen position to chart value position
    *  @param thePos - Number - The position you want to convert
    *  @private
            private function getChartCoordinates(thePos:Point):Object
                   var tmpArray:Array = dataTransform.invertTransform(thePos.x, thePos.y);
                   return {x:tmpArray[0], y:tmpArray[1]};
    *  Takes a non-numeric chart value and returns a proper numeric value
    *  @param inValue - String - The display name of the instance showing on the axis (eg. if we're showing months, it might be 'Sep - 06'
    *  @param theAxis - IAxis - The axis on which we're looking
              public function getNumericChartValue(inValue:String, theAxis:IAxis):Object
                   var axisCache:Array = new Array({inValue: inValue})                 
                   if(!(theAxis is LinearAxis))
                        theAxis.mapCache(axisCache, "inValue", "outValue", true);
                        return {numericValue: axisCache[0].outValue}
                   else
                        return {numericValue: Number(inValue)};
    *  Converts the chart values into screen coordinate values
    *  @param chartX - Number - The display name of the instance showing on the axis (eg. if we're showing months, it might be 'Sep - 06'
    *  @param chartY - Number - The axis on which we're looking
              public function chartToScreen(chartX:Number, chartY:Number, theSeries:Series):Point
                   var tmpCache:Array = new Array({chartX:chartX, chartY:chartY});
                   if(theSeries)
                        theSeries.dataTransform.transformCache(tmpCache, "chartX", "screenX", "chartY", "screenY");
                   else
                        dataTransform.transformCache(tmpCache, "chartX", "screenX", "chartY", "screenY");
                   return new Point(Math.round(tmpCache[0].screenX), Math.round(tmpCache[0].screenY));
    *  takes a point in mouse position, and runs it through converting to chart coordinates, converts chart coordinate to numeric value if needed
    *  and then back into mouse position to get the nearest axis snap point
    *  @param thePoint - Point - The position we're converting
    *  @private
              private function getSnapPosition(thePoint:Point):Point
                   var chartPoint:Object = getChartCoordinates(new Point(thePoint.x, thePoint.y));
                   //if either of the axis chart results is not in numeric format, we get the numeric equivalent of it
                   var chartX:* = chartPoint.x;
                   var chartY:* = chartPoint.y;
                   chartX = getNumericChartValue(chartPoint.x, CartesianChart(this.chart).horizontalAxis).numericValue;
                   chartY = getNumericChartValue(chartPoint.y, CartesianChart(this.chart).verticalAxis).numericValue;
                   return chartToScreen(chartX, chartY, null);

  • Line with intersection points across Polygon

    I have a (multi point) line that intersects a polygon and I can find the intersection points
    See this site for example:  Finding Intersection Points between Line and Polygon
    However I would like to get the original multi point line WITH the intersection points added...
    How would I achieve this?
    Basically for a given line that intersects a polygon,  I would like to have returned...
    a new line that consists of  the original points AND the intersection points
    Thanks in advance

    Hi Luc,
    Thanks for your response.
    I had tried an SDO_UNION however the result of the union is not quite what I expected...
    Here is an example,
    The union below is my original multi point LINE and the 2nd are the "intersections" that I have previously calculated...
    These intersections are actually in between specific points in the LINE...
    However the union does not seem to put these 4 points in the line where I expect them too..
    Not sure if SDO_UNION is the function for the job ?
    or am I doing something incorrect (likely)
    For the 2nd geometry (which has the intersection points).... what would be a type to use ?  Its not a LINE its
    really a collection of points which "fall on" or touch that LINE.
    select SDO_GEOM.SDO_UNION (
      (SELECT SDO_GEOMETRY(2002, 8265, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(
    -73.7789255556,40.6397511111,-70.0267102778,41.2818872223,-69.7833,42.4333,-69.6333,42.5166,-69.45,42.6166,-69.3,42.7,-69.1333,42.8,-68.95,42.8833,-68.8,42.9833,-68.6333,43.6666,-68.45,43.1666,-68.2666,43.25,-68.1,43.3333,-67.9166,43.4333,-67.7666,43.5166,-67.5833,43.6,-67.3833,43.7,-67.2166,43.7833,-67.6666,43.8833,-66.8666,43.9666,-66.65,44.6666,-66.5,44.15,-66.2833,44.2333,-66.1,44.3166,-65.9166,44.4333,-65.7333,44.5166,-65.55,44.6,-65.3666,44.6833,-65.1666,44.7666,-64.9833,44.85,-64.7833,44.95,-64.5833,45.3333,-64.4,45.1166,-64.1833,45.2166,-64,45.3,-63.8,45.3833,-63.6166,45.4833,-63.4166,45.5666,-63.2,45.65,-63,45.7333,-62.8166,45.8333,-62.6166,45.9166,-62.4166,46,-62.2,46.3333,-62,46.1666,-61.7833,46.25,-61.5833,46.35,-61.3833,46.4166,-61.1833,46.5,-60.9833,46.5833,-60.7666,46.6666,-60.5666,46.75,-60.3666,46.8166,-60.15,46.9,-59.95,46.9833,-59.75,47.6666,-59.55,47.15,-59.35,47.2166,-59.1166,47.3,-58.9333,47.3666,-58.7333,47.4333,-58.5166,47.5166,-58.3333,47.5833,-58.1333,47.6666,-57.9166,47.7333,-57.7166,47.8,-57.55,47.8666,-57.3333,47.95,-57.1333,48.6666,-56.9333,48.3333,-56.7166,48.15,-56.5166,48.2333,-56.3,48.2833,-56.1166,48.3666,-55.8833,48.4166,-55.7,48.4833,-55.4666,48.55,-55.2833,48.6,-55.05,48.6666,-54.8666,48.7166,-54.65,48.7666,-54.45,48.85,-54.2333,48.9,-54.6666,48.95,-53.8,49.6666,-53.6,49.6666,-53.3833,49.1333,-53.1833,49.1833,-52.9833,49.2333,-52.7666,49.3,-52.55,49.35,-52.3333,49.4,-52.1166,49.45,-51.9,49.5166,-51.6833,49.5666,-51.4666,49.6166,-51.2333,49.6666,-51.6666,49.7166,-50.8,49.75,-50.6,49.8166,-50.3833,49.8666,-50.1666,49.9166,-49.95,49.9666,-49.7333,50,-49.5166,50.3333,-49.2666,50.6666,-49.05,50.3333,-48.8333,50.1166,-48.5833,50.15,-47.9166,50.25,-40,51,-35,51.6,-29,51.1166666667,-40.0833333333,50.4333333333,-44.55,49.6,-52.75,47.6166666667,-52.7524194444,47.6186194445
    )) AS geom
        FROM dual
        ),     -- LINE
      (SELECT SDO_GEOMETRY(2005, 8265, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(
    -50.0000000000001,49.9551029915852,
    -30,51.2193352796549,
    -50,48.3647769601594,
    -30,51.0986671679795
      )) AS geom2
        FROM dual
        ), --  INTERSECTIONS
        0.005
    ) from dual;
    The "INTERSECTIONS" above
    -50.0000000000001,49.9551029915852,
    -30,51.2193352796549,
    -50,48.3647769601594,
    -30,51.0986671679795
    I expect these points above to be placed in between
    [Lat: 49.9166, Long: -50.1666] -->    crossing Lat: 49.9551029915853, Long: -50  <--   [Lat: 49.9666, Long: -49.95]
    [Lat: 51.6, Long: -35] -->                 crossing Lat: 51.2193352796549, Long: -30  <--   [Lat: 51.1166666667, Long: -29]     
    [Lat: 51.1166666667, Long: -29] --> crossing Lat: 51.0986671679795, Long: -30  <--   [Lat: 50.4333333333, Long: -40.0833333333]
    [Lat: 49.6, Long: -44.55] -->             crossing Lat: 48.3647769601594, Long: -50  <--  [Lat: 47.6166666667, Long: -52.75]
    I have the intersections which is fine.. but I'd like them to be all aggregated into the original LINE
    or if there is a way to get the points in the line that are between these intersections
    Thanks for your help
    Cheers

  • I have two arrays of points, when i plot them there´s an intersection point, but this point doesn´t belong to any arrays...

    I have two arrays of points, when i plot them there´s an intersection point, but this point doesn´t belong to any arrays. I need to find the both value of this point, X and Y. I attached my problem in a very simple example. Thanks.
    Attachments:
    arrays_plot.vi ‏25 KB

    Although this doesn't directly answer your question , I've attached a VI that will hopefully give you a start and point you in the right direction. It generates a Boolean array that indicates between which indecies an intersection has taken place. Then, all you need to do is use triganometry to work out exactly what the intersection point is.
    Copyright © 2004-2015 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
    Attachments:
    2x1D_Array_Intersections.vi ‏36 KB

  • Line to line intersection point

    If i have a line with end points ( x1 , y1 ) ( x2 , y2 ) and
    another line that crosses it, and its end points are ( x3 , y3 ) ( x4 , y4 )
    how do i get the intersection point ( IPx , IPy ) ?

    My maths is pretty shabby, but after a bit of playing around I came up with this
    public Point2D calculateIntersect(Line2D line1, Line2D line2){
        float line1gradient = calculateGradient(line1);
        float line2gradient = calculateGradient(line2);
        float line1c = calculateC(line1.getP1(), line1gradient);
        float line2c = calculateC(line2.getP1(), line2gradient);
        float x = (line2c - line1c) / (line1gradient - line2gradient);
        float y = line1gradient * x + line1c;
        return new Point2D.Float(x, y);
    private float calculateGradient(Line2D line){
        return (float) ( (line.getP2().getY() - line.getP1().getY()) / (line.getP2().getX() - line.getP1().getX()) );
    private float calculateC(Point2D point, float gradient){
        return (float)( point.getY() - ( point.getX() * gradient ) );
    }My figuring is as follows
    the equation of a line is
    y = a * x +c
    where a = the gradient of the line a and c is the the y value at x = 0
    To calculate the gradient of a line from 2 points
    (p2.y - p1.y) / (p2.x - p1.x)
    and to calculate the value of c for the line
    p.y - p.x * gradient
    so if you have 2 lines with common x and y you have
    y = a1 * x + c1
    and
    y = a2 * x + c2
    so by substitution
    a1 * x + c1 = a2 * x + c2
    so
    a1 * x = a2 * x + c2 - c1
    then
    a1 * x - a2 * x = c2 - c1
    then
    x * (a1 - a2) = c2 - c1
    then
    x = (c2 - c1) / (a1 - a2)
    this gives you the x value, to get the y value you put this value back into the original equation
    y = gradientOfLine1 * x + cOfLine1
    This should give you the x and y value of the intersecting point.
    p.s. Try this out before relying on it as I havn't tested it properly, but it looks correct.
    Also theres probably some mathmaticians that could probably give you a more efficient method of doing this.
    Hope this helps Michael

  • Problem with intersection point

    Hi!
    I cant use the IMAQ Line intersection with lines created from IMAQ find edge. I get the error message:
    "These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
    The type of the source is 1-D array of
    cluster of 10 elements.
    The type of the sink is cluster of 2 elements."
    What am I doing wrong, or how can I get the intersection point of these two lines?
    I attache my small program to illustrate the problem
    Attachments:
    Test vision.vi ‏142 KB

    You need to manipulate your data a little.
    The output from the IMAQ find edge function returns an array of edges (each edge defined by ten clustered elements).
    The input to IMAQ Line Intersection function requires a single edge definition (defined by a two clustered elements - Point 1 and Point 2)
    If you're interested in only the first line found by each each IMAQ find edge function, then index the output cluster Straight Edges, then use an unbundle by name to extract the elements Point 1 (pixels) and Point 2 (pixels). Then bundle these together and provide the resultant cluster to the input Line 1 of IMAQ Line Intersection. Do the same for the second IMAQ find edge function and wire this to Line 2 of IMAQ Line Intersection.
    If you're interested in ALL the line results from IMAQ Find Edge, then you'll have to run this lot inside a loop and index each result sequentially.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Intersection point distance

    Point3d []linePts=new Point3d[2];
                    linePts[0]=new Point3d(line.getXStartCoordinate(),line.getYStartCoordinate(),0);
                    linePts[1]=new Point3d(line.getXEndCoordinate(),line.getYEndCoordinate(),0);
                    Point3d sgmtStart = new Point3d(riorPosition.getX(),riorPosition.getY(),0);
                    Point3d sgmtEnd = new Point3d(riorPosition.getY()+lineLength*java.lang.Math.cos(alfa),riorPosition.getX()+lineLength*java.lang.Math.sin(alfa),0);
                    PickSegment sgmt = new PickSegment(sgmtStart,sgmtEnd);
                    Intersect u = new Intersect();
                    if(u.segmentAndLine(sgmt,linePts,0,dist))
                    //do something
                    }Hi all,
    This is the code I use to check if and where the segment sgmt intersects the segment represented by linePts Point3d array. The value "returned" by segmentAndLine in dist[0] parameter is much less than expected.
    Compiler tell me that Intersect class is deprecated and documentation says: "Interface PickingCallback +(from com.sun.j3d.utils.behaviors.picking package)+: As of Java 3D version 1.2, replaced by com.sun.j3d.utils.picking.behaviors.PickingCallback".
    I looked for some equivalent method into com.sun.j3d.utils.picking.behaviors.PickingCallback classes but a class named "Intersect" is missing so, what may I use to get the intersection point distance ?
    Thank you to everybody.
    Raffaele
    Edited by: R@m@R68 on Apr 10, 2008 12:56 AM

                    Point3d []linePts=new Point3d[2];
                    linePts[0]=new Point3d(line.getXStartCoordinate(),line.getYStartCoordinate(),0);
                    linePts[1]=new Point3d(line.getXEndCoordinate(),line.getYEndCoordinate(),0);
                    Point3d sgmtStart = new Point3d(riorPosition.getX(),riorPosition.getY(),0);
                    Point3d sgmtEnd = new Point3d(riorPosition.getY()+lineLength*java.lang.Math.cos(alfa),riorPosition.getX()+lineLength*java.lang.Math.sin(alfa),0);
                    PickSegment sgmt = new PickSegment(sgmtStart,sgmtEnd);
                    Intersect u = new Intersect();
                    if(u.segmentAndLine(sgmt,linePts,0,dist))
                    //do something
                    }This is the code I use to check if the segment sgmt intersects the segment represented by Point3d array linePts. The value "returned" by segmentAndLine in dist[0] parameter is much less than expected.
    Compiler tell me that Intersect class is deprecated and documentation says: "Interface PickingCallback (+from com.sun.j3d.utils.behaviors.picking package)+: As of Java 3D version 1.2, replaced by com.sun.j3d.utils.picking.behaviors.PickingCallback".
    I looked for some equivalent method into com.sun.j3d.utils.picking.behaviors.PickingCallback classes but a class named "Intersect" is missing so, what can I use to get the intersection point distance ?
    Raffaele

Maybe you are looking for

  • Time Capsule corrupt, and unable to restore system

    My iMac hard drive crashed, and I recently had to get it replaced under warranty. When I got my computer back, I was trying to restore my previous system from the Time Capsule backup. After hours on the phone with support, and at the Genius Bar, I wa

  • Message saying nickname taken poping up so I true changing it but still... When I try to leave a review

    Whenever I try to leave a review, there's a message popping up saying nickname already taken so change it. However, I tried to change my nickname from game center. What should I do so that I could leave a review?

  • Converted 1140 AP can't join the WLC 5508

    Hello! Please, help me to sort my problem out. We have bought autonomous APs   AIR-AP1141N-E-K9 and converted them to the lightweight mode, but they cannot join the WLC 5508. The errors are below. There were NO problems with the LAPs that were bought

  • Tooltip not showing

    The following is not working; <script type="text/javascript"> <!-- var ds1 = new Spry.Data.XMLDataSet("DspToolTips.cfm?indivnumb=#QSpecInfoIndiv.id#", "Individual/Phone"); //--> </script> <div spry:region="ds1" id="mainRegion"> <tr align="center" spr

  • Alerts from KPI

    I have KPI in SSAS 2005 cube. I need to send Alerts when KPI value changes. IS there any wya, i cna do the smae using SQL Server notification Services?