Pick Point Method

I'm using the 3D picture control for my application, and I want to be able to select objects I have created, by clicking on them with the mouse.
I have tried using the  Pick Point Method of the 3D Picture control with no luck.
Has anyone managed to do this yet
Thanks

Thanks for the feedback
The subtract was left over from debugging, decrement is defiantly the better option!
I also agree it would make more sense to return a "No Object" message.
I have updated the example to reflect these changes.
The timeout case is actually to hide a little bug in the code
When the code first starts up two of the blocks do not appear....... and I can not work out why!  They only appear after the event structure has executed at least once so the timeout case was to force this execution.  As you rightly say there is no other purpose for it when using the event structure in this manor.
Again, thanks for the feedback
John.P | Certified LabVIEW Architect | NI Alliance Member

Similar Messages

  • Stock Removal using Pick Point

    Hi all,
    I have configure Storage Type 100 with SU managed and a pick point ST 001.
    Once the TO is generated from delivery, the TO information will be from source ST100 to destination ST916.
    So I would like to know, how to identify the SU is arrived pick point? If there any status or information can help me to know the status of TO.
    Since i need to identify,
    1.SU still in the Source Storage Type (TO open)
    2.Worker starts transfer to SU to pick point with liftfork
    3.SU arrived Pick point
    4.Picker picked the material from pick point (TO picked)
    5.Picker transferred the material to GI area (TO transferred and completed)
    I dun know how to let user know the status of 2 and 3
    Thanks in advance.
    David Tai

    Hi David,
    If the pick point / ID point is defined for SType 100 then during transfer order creation system will automatically stamps the destination storage type as Pick point when it is taking out the stock from Stype  100
    I have simulated one scenario where for my storage type 010 the ID point / Pick Point is defined as 011
    Stock removal / putaway defined in material master & Stock in Storage bin are as below
    & the Putaway / Picking storage type search is defined as
    Now for the Transfer order creation i am using the T-Code  LT09 (enter the SU number & MvT and system automatically propose 011 as destination storage type in the transfer order
    Upon confirmation of the transfer order 0168, use LT09 again to transfer the SU from Pick point to final destination bin and system automatically propose 010 as the final destination storage type
    Hope this helps

  • Storage section check indicator --   ID & Pick point

    Dear Gurus ,
    1.  I have defined new storage type with  NO storage section check. then maintained material with storage type indicaor.with storage type search strategy only.
      in this case the system does not suggest the bin  or even storage type.
    But if i maintain the storage section indicator & section search strategy then the system proposing Bin while creating TO.
        Then what is the use of deactivating the storage section check while defining the storage type??
    2. Can anybody explain me what is the ID point storage type & Pick point storage Type.
    Is it mean that the perticular material from storage type can be only  picked or putaway  from  the
    storage type that is assighned ID or pick point?
      If yes in which scenario it will be utilised or how it works?

    What are the other influencing factors you have set for your storage type search? For example stock status, WPC? Activity - E or A or 2-step?
    2. Can anybody explain me what is the ID point storage type & Pick point storage Type.
    See here for ID point:
    http://help.sap.com/saphelp_erp2005/helpdata/en/c6/f846b74afa11d182b90000e829fbfe/frameset.htm
    and here for Pick Point:
    http://help.sap.com/saphelp_erp2005/helpdata/en/c6/f847124afa11d182b90000e829fbfe/frameset.htm

  • HU SU and Pick Point Partial Picking

    Hi,
    I have an scenario where I dont want to make partial picking of an Handling unit in storage type with bulk strategy, I was trying to use the pick point however is there a form that first make the transfer order for the complete HU to the pick point and then it ask me for the pick HU to 916, because it seems that the standar behavior is to create the pick HU during the confirmation of the transfer order to 916 and leave the rest of the HU in the pick point, is it correct?
    Thx.

    Hi Mariana,
    You are experiencing standard SAP.
    As I understand you want some kind of two-step picking but it doesn't work trhough pick point. As I understand you would like to do this:
    1. TO from nromal storage type to pick point
    2. TO from pick point to interim storage type
    However, system executes the WM goods movement via one TO:
    1. TO from normal storage type to interim storage type
    It doesn't matter you use a pick point or not.
    Please read SAP online help how the process goes:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/f8471f4afa11d182b90000e829fbfe/frameset.htm
    Regards,
    Csaba

  • Change pointer method

    Hi Experts,
    I followed the following steps for change pointer method.
    1.BD61- change pointers activated -generally
    2.BD50 -Activate change pointers for  message type 'OILT01'.
    3.BD52 - add the triggering fields and corresponding tables and change document object.
    But when I run the program RBDMIDOC and give the message type I found an error message that " Message type OILT01 cannot be sent with change pointers" .Please help.
    regards,
    Jeetu

    hi,
    I dont think we have run the program RBDMIDOC for implementing chagne pointer method
    <b>Activating Change Pointers</b>
    Change pointer generation has to be activated at both the
    general level and message type.
    1) Goto BD61, check the checkbox Change pointers activated - generally.
    2) Save
    3) Goto BD50, Choose the row for message type MATMAS, and check mark the corresponding field
    4) Save
    Converting change pointers to IDOCs
    • Create, change or mark for deletion materials using
    transaction MM01, MM02, or MM06.
    • Execute transaction BD21
    • Enter Message type MATMAS
    • Execute
    You can see tha changes gets reflected in 810 client that are done in 800 client.
    Regards,
    Sailaja.

  • Change pointer  method in IDOC.

    hi,
    Plz tell me necessary steps for data  transfer using change pointer method . after
    Activate change pointers   ,De-activate change pointers. run of program RBDMIDOC ,RBDCPCLR   , what other programs we  need to execute related to this change pointer method . I thin I m missing 2 more steps for this method..
    Thanks.

    Hello sranjna ,
    These are the steps for change pointer :
    1. BD61 :Activate change pointer generally .
    2. BD50 :Activate change pointer for message type.
    3. BD21 :Create IDOC type from change pointers.
    4.Save the content : create a variant .
    5.For automatically process:go to SM36  :Create a job with the program "RBDMIDOC " and the variant you created.
    Also see the link if you want :
    [http://help.sap.com/saphelp_nw04/helpdata/EN/12/83e03c19758e71e10000000a114084/frameset.htm]
    Good Luck,
    Boaz

  • Reorder Point Methods - Context: APO SNP Heuristic

    Hi all,
    I need to prepare a little summary of lot sizing options for a customer. I spent some time on help.sap.com and on the application help trying to find a clear explanation of the various reorder point methods (numbered from 1 to 6), but I couldn't get clear one-sentence explanations of these 6 sub-methods.
    Can somebody help me?
    Regards,
    Jean-Louis

    I have to precise that the framework of my question is SNP heuristics. Reorder Point is also a concept used in PP/DS, and sometimes in my opinion one can easily be confused reading the on-line help with which statement is relevant for SNP Heuristics v which statement refers to PP/DS.
    Having said that, here is my current understanding of the reorder point methods in the framework of SNP heuristics:
    <b>1 - “Reorder stock based on location product master”</b>
    The reorder point is read from the location product master (lot size tab, field reorder point)
    The reorder point represents a threshold value for available stock on hand, which stock should not fall below in the planning.
    <b>2 - “Reorder supply based on location product master “</b>
    The field “Reorder Days’ Supply” is used
    The system reorders according to what is missing to cover the demand over the specified number of days, considering the stock on hand and the planned receipts.
    <b>3 - Maximum from MB and MR from location product master</b>
    Both the “Reorder Point” and the “Reorder Days’ Supply” fields are used
    The “Reorder Day’s Supply” logic is used, but additionally the stock cannot fall below the “Reorder Point”
    <b>4 - Reorder Point (time-dependent maintenance)</b>
    Same as “1”, however the reorder point is read from a KF rather than from master data
    Additionally the “Max Stock Level” field is used
    <b>5 - “Reporting Day’s Supply (time-dependent maintenance)”</b>
    Same as “2”, however the reorder days' supply is read from a KF rather than from master data
    Additionally the “Max Stock Level” field is used
    <b>6 - “Maximum from MB and MB (time-dependent maintenance)</b>
    Same as “3”, however the reorder point and the reorder days’ supply are read from KFs rather than from master data
    Additionally the “Max Stock Level” field is used
    Please comment if what's above is correct. And thanks to all contributors.

  • POSC setting to create WTs automatically to putaway remaining qty from pick point to original bin

    Hello,
    In Layout oriented storage control for out bound process, I removed the HU at intermediate storage type as pick point and removed partial qty as per the OBD and completed whole process. This is OK as per the POSC setting. Now my original HU iwith remaining qty is still at pick point. I need to place it at original storage bin. I can easily do it with manually with WPT 9999. But if I want that, system should create  warehouse task automatically from ID point  remaining qty in original HU to original storage type-BIn. Is there any setting for this?  In other word, how can I configure the system to create 3rd  task automatically to put away remaining qty from pick point area to original storage bin of product? 
    Thanks,
    Milind.

    Hi  MILIND
    In this case you can use exception handling and achieve. Create exception code in which WpT will be create WT to original bin. Fixed bin transfer from ID point to the mat available.
    Regards
    Suraj

  • WM Pick point

    Hi,
    for picking from a storage type that is managed by a sub-system I would like to set up a pick point storage type similar to the identification storage type for inbound movements.
    I checked the pick point functionality, but that is not what we are looking as it is restricted to handling partial picks in SU managed storage types.
    Basically we want any outbound movement from our externally managed storage type to move through a storage type / area / bin.
    Any ideas?
    Regards
    Andreas

    Hi,
    It was not clear to me why the pick point doesn't fulfill your requirement. Both full and partial SUs go trough it when you do the picking.
    Of course, if you don't want to restrict the process only to SU-managed storage types, you cannot use it. But you wrote:
    I was rather looking for something analogous to the identfication point for inbound processes:
    ID point is used only in case of SU management...
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/f8471f4afa11d182b90000e829fbfe/frameset.htm
    Other solution might be VAS:
    http://help.sap.com/saphelp_47x200/helpdata/en/17/e8d63790630c4fbd27b0dea62d89b7/frameset.htm
    Just my ideas I don't know what is the best solution.
    Regards,
    csaba

  • Picking point on object

    Hi,
    maybe I'm to stupid or I'm looking just in the wrong places.
    I got a 3D scene containing 1 object... now I want to change the point which is the center of my rotation. A click in the scene shall define around which point the object shall rotate.
    I now want to get the point where a ray casted from the point I've clicked hits the object. So that the choosen point is on the surface of this object.
    Maybe someone could point me to any source where I can find info about getting the point on a surface by picking.
    Even better would be if someone could give me a brief example.
    Thanx!

    I have some code that may help:
    from J3D.org
    public static PickRay createPickRay(Canvas3D canvas, int x, int y)
    Point3d eye_pos = new Point3d();
    Point3d mouse_pos = new Point3d();
    canvas.getCenterEyeInImagePlate(eye_pos);
    canvas.getPixelLocationInImagePlate(x, y, mouse_pos);
    Transform3D motion = new Transform3D();
    canvas.getImagePlateToVworld(motion);
    motion.transform(eye_pos);
    motion.transform(mouse_pos);
    Vector3d direction = new Vector3d(mouse_pos);
    direction.sub(eye_pos);
    return new PickRay(eye_pos, direction);
    Given three points in a plane, a camera point Cp, and a camera vector Cv,
    calculate the intersection of the line (defined by passing through the camera point
    and parallel to the camera vector) and the plane
    (defined by the three points p1, p2, p3)
    public static Point3d getIntersection(Point3d p1, Point3d p2, Point3d p3,
    Tuple3d Cp, Tuple3d Cv )
    // normal vector to plane
    // n = (p2-p1)X(p3-p1)
    Vector3d v1 = new Vector3d(p1);
    Vector3d v2 = new Vector3d(p2);
    Vector3d v3 = new Vector3d(p3);
    v3.sub(v1);
    v2.sub(v1);
    Vector3d n = new Vector3d();
    n.cross(v2,v3);
         // parameter for the parametric equation of a line
    // t = ( n.p1 - n.Cp ) / n.Cv
         double t = ( n.dot(v1) - n.dot(new Vector3d(Cp)) ) / n.dot(new Vector3d(Cv));
         // plug parameter t into parametric equation for camera line of sight
    Point3d lineIntersect = new Point3d();
         lineIntersect.x = Cp.x + Cv.x * t;
         lineIntersect.y = Cp.y + Cv.y * t;
         lineIntersect.z = Cp.z + Cv.z * t;
         return lineIntersect;
    Then the above two methods are called from my mouseClicked method (when user clicks on canvas3D, given MouseEvent m)
    Canvas3D canvas = (Canvas3D)m.getSource();
    Point3d cameraPosition = new Point3d();
    Vector3d cameraVector = new Vector3d();
    PickRay ray = createPickRay(canvas, m.getX(), m.getY());
    SceneGraphPath pickedPath = locale.pickClosest(ray);
    Node pickedNode = pickedPath.getObject();
    ray.get(cameraPosition, cameraVector);
    // three arbitrary points from the face you want to intersect
    // I wanted to intersect the xy plane
    Point3d p1 = new Point3d(0,0,0);
    Point3d p2 = new Point3d(1,0,0);
    Point3d p3 = new Point3d(0,1,0);
    Point3d intersect = getIntersection(p1, p2, p3, cameraPosition, cameraVector);
    Let me know if this helps!

  • F110 AUTOMATIC PAYMENT PROGRAM  NOT PICKING PAYMENT METHOD

    hi guru's
    F110 - Running payment program proposal list going to exeption list , House bank not picking up from VENDOR master. if not maintaing house bank in vendor master
    proposal list is coming but 2nd house bank picking but i need 1 house bank. i maintained ranking order in FBZP.
    pls suggest me this issue.
    raj.

    Hi,
    I had an other problem with payment methods and in that case it was important how you fill it in the vendor and in the payment run. prhaps this helps you to found a solution or to understand how it is working
    I have set-up a new payment method "E" for splitting euro payments under EUR 50,000 (K is for the other and non iban payments)
    For this I have made the following settings in the Bank determination:
    PM Rank order House bank
    E 1 733BE
    K 2 733BE
    In the vendor masterdata I will fill in EK (to make it easy for users)
    When I run the payment method with KE the system is using K and not E. when I fill in EK the IBAN payments are going with E and and the other one's with K what is correct.
    Why is the Rank order not working for this? (look first to E and when E is not permitted go use K)
    Paul

  • Problem adding more than one point method in xmlrpc...

    Hello,
    I have an java program that connects to an webserver and communicates with an php file through xmlrpc. I have the need for more functions and so I need a little help here to have my server process each request:
    function Login($xmlrpcmsg)
    $result = "Hi from the server, " . "Username: " . $xmlrpcmsg->getParam(0)->scalarVal() . " Password: " . $xmlrpcmsg->getParam(1)->scalarVal();
    return new xmlrpcresp(new xmlrpcval($result, "string"));
    $s = new xmlrpc_server(array(
    "XmlRpcDemo.Login" => array(
    "function" => "Login",
    "signature" => $login_sig)
    basically i need $s to point to different methods. Like and register method for instance. Let me show you by code example:
    $s = new xmlrpc_server(array(
    "XmlRpcDemo.Login" => array(
    "function" => "Login",
    "signature" => $login_sig))
    "XmlRpcDemo.Register" => array(
    "function" => "Register",
    "signature" => $login_sig)));
    but that doesnt work you see? So how do I get this to work. Please help me!
    Much Appreciated,
    Aric Holland

    That code isn't Java. That is PHP.

  • Color Picker scripting or Levels algorithm help

    First question is: Does anyone know of a good explanation of the Levels algorithm as in how each setting affects a pixel in an image. If I change the midpoint of the levels, how would a specific pixel change in relation to that? I've been experimenting for hours and can't figure a common factor other than it seems to be a binary type relationship. The reason I ask this is because I'm trying to script something that will balance colors.
    If that method isn't practical, I can go to the old fashioned trial and error method but this way also presents a roadblock to me. I set a color picker point and the script can obtain the values from that point exactly as it is in the Info panel. If I put a levels adjustment layer over top and adjust it, I now see the original color value and the adjusted color value in the Info panel, but I can't figure out how to obtain the adjusted value with a script. It still returns the original value. Does anyone know a way to obtain the adjusted value?
    I hope I explained this right.

    Thanks, Michael.
    I'll have to look through that post on ps-scripts.com in more detail. That might be what I need.
    This little snippet you wrote:
    Michael L Hale wrote:
    This thread may help with the levels part. http://ps-scripts.com/bb/viewtopic.php?t=2498
    As for the adjustment layer you need to get the color twice. Once with the adjustment layer visible then again with it not visible.
    var csColor = activeDocument.colorSamplers[0].color;
    activeDocument.layers.getByName('Levels').visible = false;
    var csColor2 = activeDocument.colorSamplers[0].color;
    alert( csColor2.rgb.red + " : " + csColor.rgb.red );
    doesn't get me the before and after values. Example: The point I selected has a red value of 226. I added a Levels adj layer on top and moved the midpoint so the red value at that point (adjusted) was 234. I ran your code and it came back with 225.591439688716 : 225.591439688716. It isn't showing the adjusted value of that point.

  • Picking question.

    I have been beating my head on this for days and can't see what the problem is. All I want to do is to pick a point on a sphere and then at that point project a cylinder into the sphere.
    I can get the thing to place the pont in the sphere, but not at the point I pick. If I keep picking other points, the cylinder will move slightly one way or the other, but not to the extent it needs to.
    Any help is REALLY appreciated.
    Here is the code:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.media.j3d.AmbientLight;
    import javax.media.j3d.Appearance;
    import javax.media.j3d.BoundingSphere;
    import javax.media.j3d.BranchGroup;
    import javax.media.j3d.Canvas3D;
    import javax.media.j3d.ColoringAttributes;
    import javax.media.j3d.DirectionalLight;
    import javax.media.j3d.GeometryArray;
    import javax.media.j3d.HiResCoord;
    import javax.media.j3d.Locale;
    import javax.media.j3d.PhysicalBody;
    import javax.media.j3d.PhysicalEnvironment;
    import javax.media.j3d.Shape3D;
    import javax.media.j3d.Transform3D;
    import javax.media.j3d.TransformGroup;
    import javax.media.j3d.View;
    import javax.media.j3d.ViewPlatform;
    import javax.media.j3d.VirtualUniverse;
    import javax.swing.JFrame;
    import javax.vecmath.AxisAngle4d;
    import javax.vecmath.Color3f;
    import javax.vecmath.Point3d;
    import javax.vecmath.Vector3d;
    import javax.vecmath.Vector3f;
    import com.sun.j3d.utils.behaviors.mouse.MouseRotate;
    import com.sun.j3d.utils.behaviors.mouse.MouseTranslate;
    import com.sun.j3d.utils.geometry.Cylinder;
    import com.sun.j3d.utils.geometry.Sphere;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    //import com.tornadolabs.j3dtree.Java3dTree;
    public class DisplayFrame extends JFrame implements PointSelectedReceiver
        private Transform3D     pointT3D = new Transform3D();
        private TransformGroup  pointTG;
        private VirtualUniverse universe;
        //private Java3dTree      j3dTree;
        private Canvas3D        canvas3D;
        private Vector3d        pointCurrTrans = new Vector3d();
        private Transform3D     pointRotT3D    = new Transform3D();
        private static final Vector3d ORIGIN = new Vector3d(0, 0, 0);
         * @param args
        public static void main(String[] args)
            DisplayFrame mainframe = new DisplayFrame();
            mainframe.init();
            mainframe.setPreferredSize(new Dimension(1280, 1024));
            mainframe.setMinimumSize(new Dimension(1024, 768));
            mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            mainframe.pack();
            mainframe.setVisible(true);
        private void init()
             universe = new VirtualUniverse();
             canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration());
             int[] xPos = {0,0,0,0,0,0,0,0};
             int[] yPos = {0,0,0,0,0,0,0,0};
             int[] zPos = {0,0,1,5,0,0,0,0};
             HiResCoord hiResCoord = new HiResCoord(xPos, yPos, zPos);
             //j3dTree  = new Java3dTree();
             Locale locale = new Locale(universe, hiResCoord);
             BranchGroup scene = createSceneGraph();
             //j3dTree.recursiveApplyCapability(scene);
             scene.compile();
             locale.addBranchGraph(scene);
             BranchGroup vpBranchGroup = new BranchGroup();
             TransformGroup tg = new TransformGroup();
             ViewPlatform vp = new ViewPlatform();
             vp.setViewAttachPolicy(View.RELATIVE_TO_FIELD_OF_VIEW);
             tg.addChild(vp);
             vpBranchGroup.addChild(tg);
             locale.addBranchGraph(vpBranchGroup);
             View view = new View();
             view.setProjectionPolicy(View.PARALLEL_PROJECTION);
             PhysicalBody        pb = new PhysicalBody();
             PhysicalEnvironment pe = new PhysicalEnvironment();
             view.setPhysicalEnvironment(pe);
             view.setPhysicalBody(pb);
             view.attachViewPlatform(vp);
             view.setBackClipDistance(110);
             view.setFrontClipPolicy(View.VIRTUAL_EYE);
             view.addCanvas3D(canvas3D);
             this.setLayout( new BorderLayout() );
             this.setSize(new Dimension(1024,768));
             this.setMinimumSize(new Dimension(1024, 768));
             this.add("Center", canvas3D);  
             //j3dTree.updateNodes(universe);
        private BranchGroup createSceneGraph()
            BranchGroup objRoot = new BranchGroup();
            double scale = 0.02d;
            Transform3D myTransform3D = new Transform3D();
            myTransform3D.setScale(scale);
            TransformGroup mainTG = new TransformGroup(myTransform3D);
            mainTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
            mainTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            mainTG.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
            mainTG.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
            //Test a color cube
            Sphere sphere = new Sphere(10.0f);
            sphere.setPickable(true);
            sphere.getShape().setCapability(Shape3D.ENABLE_PICK_REPORTING);
            sphere.getShape().setCapability(Shape3D.ALLOW_GEOMETRY_READ);
            sphere.getShape().getGeometry().setCapability(GeometryArray.ALLOW_COUNT_READ);
            sphere.getShape().getGeometry().setCapability(GeometryArray.ALLOW_FORMAT_READ);
            sphere.getShape().getGeometry().setCapability(GeometryArray.ALLOW_COORDINATE_READ);
            sphere.getShape().getGeometry().setCapability(GeometryArray.ALLOW_REF_DATA_READ);
            sphere.setCapability(Sphere.ALLOW_PICKABLE_READ);
            Transform3D sphereT3D = new Transform3D();
            sphereT3D.setTranslation(new Vector3d(0.0f, 0.0f, 0.0f));
            TransformGroup sphereTG = new TransformGroup(sphereT3D);
            sphereTG.addChild(sphere);
            mainTG.addChild(sphereTG);
            //Add lighting
            BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
            Color3f ambientColor          = new Color3f(0.9f, 0.9f, 0.9f);
            Color3f directionalLightColor = new Color3f(0.6f, 0.6f, 0.6f);
            AmbientLight ambientLightNode = new AmbientLight(ambientColor);
            ambientLightNode.setInfluencingBounds(bounds);
            mainTG.addChild(ambientLightNode);
            DirectionalLight directionalLight = new DirectionalLight(directionalLightColor, new Vector3f(+0.0f, +0.10f, +0.00f) );
            directionalLight.setInfluencingBounds(bounds);
            mainTG.addChild(directionalLight);
            //Add an object to indicate the point picked
            pointTG = new TransformGroup();
            pointTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
            pointTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
            pointT3D.setTranslation(new Vector3d(-20.0f, 0.0f, 0.0f));
            pointTG.setTransform(pointT3D);
            Appearance         pickAp    = new Appearance();
            ColoringAttributes colorAtt  = new ColoringAttributes();
            Color3f            pickColor = new Color3f(0.0f, 0.5f, 0.8f);
            colorAtt.setColor( pickColor );
            pickAp.setColoringAttributes( colorAtt );
            Cylinder pointIndicator = new Cylinder(0.25f, 25.0f, pickAp); 
            pointIndicator.setPickable(false);
            pointTG.addChild(pointIndicator);
            mainTG.addChild(pointTG);  
            //Add the picking behavior next
            PointPickBehaviour picking = new PointPickBehaviour(canvas3D,
                                                                objRoot,
                                                                bounds,
                                                                DisplayFrame.this);
            mainTG.addChild(picking);
            MouseRotate behavior = new MouseRotate();
            behavior.setTransformGroup(mainTG);
            mainTG.addChild(behavior);
            behavior.setSchedulingBounds(bounds);
            MouseTranslate behavior2 = new MouseTranslate();
            behavior2.setTransformGroup(mainTG);
            mainTG.addChild(behavior2);
            behavior2.setSchedulingBounds(bounds);
            objRoot.addChild(mainTG);
            objRoot.setCapability(BranchGroup.ENABLE_PICK_REPORTING);
            return objRoot;
        public void receiveSelectedPoint(Point3d point)
            pointT3D.setTranslation(new Vector3d(point.x, point.y, point.z));
            pointTG.setTransform(pointT3D);
        public void receivePickRotation(AxisAngle4d rotAxis)
            pointTG.getTransform( pointT3D );
            pointT3D.get( pointCurrTrans ); 
            pointT3D.setTranslation( ORIGIN );
            pointT3D.setRotation( rotAxis ); 
            pointT3D.mul(pointRotT3D);
            pointT3D.setTranslation( pointCurrTrans );
            pointTG.setTransform( pointT3D );
    }Now the code to the pick itself:
    import javax.vecmath.*;
    import javax.media.j3d.*;
    import com.sun.j3d.utils.picking.*;
    import com.sun.j3d.utils.picking.behaviors.PickMouseBehavior;
    public class PointPickBehaviour extends PickMouseBehavior
      private PointSelectedReceiver receiver;
      private boolean               firstRotation;
      private AxisAngle4d           rotAxisAngle   = new AxisAngle4d();
      private Vector3d              clickVec       = new Vector3d();
      private Vector3d              axisVec        = new Vector3d();
      private double                pickAngle;
      private Point3d               startPt;
      // initial orientation of pick pointer: straight up
      private static final Vector3d UPVEC = new Vector3d(0.0, 1.0, 0.0);
      // for repeated calculations
      public PointPickBehaviour(Canvas3D    canvas,
                                BranchGroup root,
                                Bounds      bounds,
                                PointSelectedReceiver receiver)
        super(canvas, root, bounds);
        setSchedulingBounds(bounds);
        pickCanvas.setMode(PickCanvas.GEOMETRY_INTERSECT_INFO);
        this.receiver = receiver;
      public void updateScene(int xpos, int ypos)
      /* This method is called when something is picked.
           pickCanvas.setShapeLocation(xpos, ypos);
           Point3d eyePos = pickCanvas.getStartPosition();
          startPt = eyePos;
           PickResult pickResult = null;
           pickResult = pickCanvas.pickClosest();
           if (pickResult != null)
               PickIntersection pi = pickResult.getClosestIntersection(eyePos); 
              System.out.println("Picked coordinates: " + pi.getClosestVertexCoordinates());
              Point3d intercept = pi.getPointCoordinatesVW();
              rotateToPoint(intercept);
              receiver.receiveSelectedPoint(intercept);
      } // end of updateScene()
      private void rotateToPoint(Point3d intercept)
      /* Turn the picked point to point at the point where the
         mouse was clicked.
            if (!firstRotation)
            {   // undo previous rotations to gun and beam
                axisVec.negate();
                rotAxisAngle.set( axisVec, pickAngle );
                receiver.receivePickRotation(rotAxisAngle);
            clickVec.set( intercept.x - startPt.x,
                          intercept.y - startPt.y,
                          intercept.z - startPt.z);
            clickVec.normalize();
            axisVec.cross( UPVEC, clickVec);
            pickAngle = UPVEC.angle(clickVec);
            rotAxisAngle.set(axisVec, pickAngle);     // build rotation
            receiver.receivePickRotation(rotAxisAngle);
            firstRotation = false;
      } // end of rotateToPoint()
    } Fianlly the interface to tie the two:
    import javax.vecmath.AxisAngle4d;
    import javax.vecmath.Point3d;
    public interface PointSelectedReceiver
        public void receiveSelectedPoint(Point3d point);
        public void receivePickRotation(AxisAngle4d rotation);
    }

    Well I have it sort of working (the pick indicator cylinder gets placed at the right point, but if you rotate the sphere and then select another point the cylinder isn't drawn toward the user).
    The fix was to change getPointCoordinatesVW to getClosestVertexCoordinates.

  • Check if a point lies inside a rectangle

    Hi im making an application that displays a shape on the screen at different locations. The shape is a combination of an ellipse and a line. My problem is when i want to draw the shapes i created a method to check if the point given is contained by any other shape and if it is it should create a new point. However when the .contains(Point) method is run it doesnt reply true or false so my code just goes into an infinite loop and crashes.
    Here is the checkpoint method that loops infintly
    private void setPoint(Point pow) {
              boolean anythingthere = false;
              while (anythingthere==!true) {
                   Rectangle test = list.getBounds();
                   if (test.contains(pow)) {
                        int f = pow.x;
                        f = f+200;
                        int g = pow.y;
                        pow.setLocation(f, g);
                        System.out.println(pow);
                        f = 0;
                   else {
                        if (pow.x+150 > getWidth()) {
                             pow.setLocation(50, pow.y+180);
                        anythingthere = true;
                        i++;
         }And because my shape is a combination of graphics2D shapes i created this method in its class to return the rectangle that bounds the shapepublic Rectangle getBounds() {
         bound = new Rectangle(location.x,location.y,size,size);
         return bound;
    }Thanks for any help you can give im really stumped!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi thanks for your reply's. Thanks for tips on making my code nicer and efficient ive tried to do it throughout my project so hopefully its more readable now. The problem was to do with scope like one of you said so i moved a few things round and got it working. The problem was when i called the bounds of the rectangle it was returning the bounds using the last changed point which meant that every time i tested the loop the point was inside that bound so it basically looped infinitely. One line moved and it worked perfectly.
    Thanks everyone

Maybe you are looking for

  • IPod Classic Screen still black after restoring it

    After dropping my iPod classic, the screen went black and I could no longer get it to work.  I was able to restore it however the screen is still black. I can hear it clicking when I spin the will and it connects to iTunes but the screen is still bla

  • Material group in material master for different plants

    Warm greetings Masters of Material Management We have one material master for three different plants example  1000, 2000 &3000 with same material group  with different valuation class If we change material group in plant 2000 it is reflected in 1000

  • Creating Automated Slideshow for my website?

    Is there a way to do this with perhaps a Java command or a PDF link on my site? Or is Actions involved. Also would I use Imageready if this is possible? Thank you, Allan

  • How to see changes in my ini-file of Types palette

    I added new .ini file into Types palette. When I am exiting from Teststand it asks me to save modified ini-files. How can I see what changes are made to this ini file? Now I see only *mark before my ini-file in Types palette but can't see what are th

  • Reg : Interchange in decimal notation.

    Hi Experts, We have 1 client 110 for development 210 for testing and its a cross client for 110. We have one more client 300 for Testing and then client 400 production System. I am facing problem in Client 300. As in client 110 we have developed a pr