How Convert a mouse click (X,Y) to Java3d virtual World???

i have a mouse event and i like to convert this to a world (X,Y,Z) coordinate
i am try using getPixelLocationInImagePlate, getImagePlateToVworld and getCenterEyeInImagePlate methods, but i have only the X axis, the z axis got fixed in the camera position...
same code example?
Edited by: luizrd on Feb 12, 2008 12:59 AM

luizrd wrote:
you say to use pickcanvas, but in this case, this dont work, the pickcanvas dont return the position of a empt location (i think) and i need to get the position of a click....
for add a line in the canvas in the mouse position...How are you going to get the postition of some point that not only doesn't exist, but could be returned as an infinte number of postitions along a vector. In other words, you can't do what you're talking about.

Similar Messages

  • Automator - How do I: Mouse Click, Move Windows, and more

    Hello,
    I am attempting to create my own Automator programs and for a while I had some that worked nicely. I have recently been tweaking my iMac so that it can "think" on its own (by automator of course) and do things for me. However, I've run across a block with Mavericks (I believe it's due to Mavericks).
    1. How can I get Automator to register a mouse click? "Watch me do" does not seem to want to work for me at all. I also would prefer if it would just be a registered mouse click, but not actually use the mouse (I know this is possible) so that if I'm doing something and it runs, it won't disturb my mouse and I can keep working.
    2. How can I register a keyboard stroke? Same as above
    3. How can I have automator move windows? I have two monitors and there are times when I may want it to move a window from one mintor to another
    The following is a list of all the things I'm attempting to accomplish at the moment (with other things when I think of them) with automator (either through applications, folder actions, or ical actions):
    1. Register a mouse click at a given area or on a given element in a safari page
    2. Register a keyboard stroke in a given program (be able to focus on a program and then do the keystroke)
    3. Move windows from one location to another
    4. Full-screen and Un-full-screen iTunes at certain times of day
    5. Download all purchased items on iTunes that aren't on the computer (sometimes iTunes doesn't download stuff if it was downloaded on my MacBook Pro first)
    6. Automatically voice read reminders (that I've set in Reminders) each day at a given time (I can use loop to repeat it to make sure I hear it all)
    I'll think of more of course, but the mouse click, keyboard stroke, and moving windows is the big thing I'm trying to figure out how to do. Can anyone help?
    Also, I am not a computer tech. I am tinkering with this because it's fun and helpful, but an answer of "just use applescript" or "just use java" will likely just give me a headache. I know that it's going to be one of those codes, but I'm hoping someone has a "base" code that can be copied and pasted that's just a standard click that I can adjust for where I need to click and what process I need to click on.
    If there is an Action Pack that includes a "Register Mouse Click" and/or "Register Keyboard Stroke", then that would work great, but the only action packs for automator I've seen that work with Mavericks is for photoshop.

    You're asking for a lot in one post.  It would be better to break your requests down a bit. 
    For example, to deal with mouse clicks, you can use the Automator Action Run Shell Script with this python script:
    import sys
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
            theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
            CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
            mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclick(posx,posy):
            mouseEvent(kCGEventLeftMouseDown, posx,posy);
            mouseEvent(kCGEventLeftMouseUp, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # Click the "Apple"
    mouseclick(25, 5);  
    # 1 second delay       
    time.sleep(1);        
    # Restore mouse position
    mousemove(int(currentpos.x),int(currentpos.y))
    It will look like this in Automator:
    To drag something (i.e. a window, a file icon) from position 40,60 to 60,300:
    import time
    from Quartz.CoreGraphics import *
    def mouseEvent(type, posx, posy):
               theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft)
               CGEventPost(kCGHIDEventTap, theEvent)
    def mousemove(posx,posy):
               mouseEvent(kCGEventMouseMoved, posx,posy);
    def mouseclickdn(posx,posy):
               mouseEvent(kCGEventLeftMouseDown, posx,posy);
    def mouseclickup(posx,posy):
               mouseEvent(kCGEventLeftMouseUp, posx,posy);
    def mousedrag(posx,posy):
               mouseEvent(kCGEventLeftMouseDragged, posx,posy);
    ourEvent = CGEventCreate(None);
    # Save current mouse position
    currentpos=CGEventGetLocation(ourEvent);
    # move mouse to upper left of screen
    mouseclickdn(40, 60);
    # drag icon to new location
    mousedrag(60, 300);
    # release mouse
    mouseclickup(60, 300);
    # necessary delay
    time.sleep(1);
    # return mouse to start positon
    mouseclickdn(int(currentpos.x),int(currentpos.y));
    For keystokes in AppleScript (which can be added to Automator with the Run Applescript Action) see: http://dougscripts.com/itunes/itinfo/keycodes.php

  • How to show mouse clicks when recording screen with quicktime?

    How can i show the mouse click when i record the screen using quicktime player?

    Why? What program feature do you intend to offer, by knowing what a user clicks on (besides the application itself).Hi, well what I have to do is to start the application minimized in the system tray. Then the application must be listening for crtl+shift+left click in any part of the desktop or an opened application, when that happens, I have to show a window asking if the user want to take a screenshot starting in the x,y point he clicked, once done, I have to take an screenshot...so on.
    How can I do that? Can anybody give me a hint? Thanks in advance.

  • How to detect mouse clicks on desktop?

    Hi All,
    I need to detect mouse clicks on the desktop and find out mouse position on the screen. How to listen to mouse events if I don't have any swing components like containers, panels, windows, etc? All things like "addMouseListener" are supposed to be with such components. But my program is running in the background and it doesn't have any graphical interfaces. So, I need to detect if a mouse button is pressed at any position on the screen.
    Thanks for any help!

    Why? What program feature do you intend to offer, by knowing what a user clicks on (besides the application itself).Hi, well what I have to do is to start the application minimized in the system tray. Then the application must be listening for crtl+shift+left click in any part of the desktop or an opened application, when that happens, I have to show a window asking if the user want to take a screenshot starting in the x,y point he clicked, once done, I have to take an screenshot...so on.
    How can I do that? Can anybody give me a hint? Thanks in advance.

  • How to handle mouse click event on up-arrow of JSpinner?

    Hi Everybody,
    I have a JSpinner component holding a date field in it (dd/mm/yyyy). I have handeled keyboard up and down arrow key events for the component and that's working as expected. Now I want to make it work for mouse clicks on the up (UP_ARROW_SUBCOMPONENT) and down arrow (DOWN_ARROW_SUBCOMPONENT) buttons of the component.
    Could somebody guide me how to do it? My investigatoin hints me to use JSpinnerMouseEventData but I am not exactly getting how to get it done.
    Thanks in advance!

    if you just want to add a mouseListener to the spinner's buttons, try this
    (only coded it for the up/next button)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      public void buildGUI()
        JSpinner spinner = new JSpinner(new SpinnerNumberModel(50, 0, 100, 5));
        spinner.setUI(new javax.swing.plaf.basic.BasicSpinnerUI(){
          protected Component createNextButton()
            Component c = super.createNextButton();
            c.addMouseListener(new MouseAdapter(){
              public void mousePressed(MouseEvent me){
                System.out.println("mousie, going up");
            return c;
        JFrame f = new JFrame();
        f.getContentPane().add(spinner);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How to detect mouse click event?

    Hello,
    I would like to have a vi to detect left, right and no mouse click. I mean that in the vi attached, Button2 should be 0 (no click), 1 (left c.) or 2 (right c.) depending on the event occured in i-1. cycle. My vi is the modyfied version of the one found here:
    http://www.ni.com/example/27663/en/
    Sometimes it works fine, but another time nothing happens when I click.
    I think the main problem is with the execution times at the for loop and event structure.
    Could you help me how to deal with the problem?
    Thanks you!
    Attachments:
    mouse1.vi ‏12 KB

    Hi VampireEmpire,
    Your For loop iterates twice. If an event occures during first iteration everything is fine - Button 2 refreshes during second iteration. But what happens when an event occures during second iteration? Does Button 2 have a possibility to refresh? 
    1. Do you see the problem now?
    2. And if you do - do you really need For loop? I would suggest you trying removing it and connecting shift register to the while loop.
    Bluesheep

  • How to simulate mouse click

    Hello,
    is it possible to simulate and control a mouse click in windows with labview 7.1. I am able to control the mouse coordinates but not right and left mouse click. Is there a available VI that can do that?
    Lukas

    I have answered this in the other thread where you asked this. Please don't post the same questions to multiple threads.
    After looking at the VI there, it uses the PostMessage function to post a mouse down message to a specific window. You can try using MouseEvent or SendInput to simulate a general mouse click (One of them is no longer supported, I can't remember which. You can find the details in the MSDN).
    Try to take over the world!

  • How to disable mouse click ??

    hi ,
    i have a form in which i have a block abc in this there are 5 items say a,b,c,d,e
    suppose my cursor is in item field 'a' there i have entered some value then i go to item field b and entered some value and then i go to field c without any enter or tab but with the help of mouse only. there i want to put a trigger on block level ( on-mouse-click) that whenever anyone tries to move from the current field to another field with the help of mouse then the cursor should be moved to previous item automatically that is item 'b'. in breif i want to disable mouse click from moving one field to another.
    on-mouse-click i can store system.current_item i.e 'a' but not able to store previous field i.e 'b'.
    please help....
    thanks
    Edited by: Hi FRNzzz!! on Feb 23, 2010 7:10 PM

    Hello,
    Try to set the mouse navigation limit form-level property to item when you want to disable the mouse.
    Francois

  • How to unbind mouse click 4&5 on firefox, because I use taht for an other software ?

    I want to unbind mouse click 4 & 5 on firefox.
    Because I use this buttons fort "Mumlble (chatvocal)"
    When I click on my button 4 or 5 of my mouse, firefox goes to the previous or next page. Can you help me please ?
    (I want not change my bind on mumble, it for that I want delete the button 4 & 5 of my mouse on firefox)

    Try http://www.highrez.co.uk/downloads/XMouseButtonControl.htm - X-Mouse Button Control

  • How to make mouse click event to display image on 2D array?

    Hi! beginner programmer here looking for some guidance, hints and tips.
    I'm making a game of "Connect 4" and using a 2D array to display the board which is 7x6 in size.
    What i want to do is that when the player clicks on one of the squares, one of the 2 game pieces(red.png or yellow.png) will appear on the respective coordinates of the 2D array and check if the square in the first row is empty and if true, places/display
    the game piece, else it places the piece on the first empty square.
    Since i've never worked with WinForms or 2d arrays before i'm not sure how to initiate it.
    What i was considering in pseudocode was:
    pb_Mouseclick(object sender, MouseEventArgs e)
    if(e.Button==MouseButtons.Left)
    Picturebox pb=(Picturebox)sender;
    clickLocation.X= e.Location.X + pb.Location.X, pieceArray[row];
    clickLocation.Y=e.Location.Y + pb.Location.Y, pieceArray[col];
    if(pieceArray[row, col] == null)
    if(player1.IsStarter==true) selectedimage(@"yellow.png")
    else
    selectedimage(@"red.png")
    else {
    bool empty= false;
    for(int row=0; row<height - 1; row++)
    for(int col=0; col<width; col++)
    if(pieceArray[row, col] ==null)
    empty=true;
    (Add gamepiece)
    This is what i've come up with so far, but it's just some theorycrafting, not sure if i should use a while-loop instead...
    Hope anyone can give me some insight on how to make it work and if the logic of my pseudocode is correct for what i want according to my earlier explanation.
    Many thanks in advance!
    Regards
    Gabbelino
    Student at the University of Borås, Sweden

    Hi Gabbelino,
    I could not understand your game rule clearly, and could you make explanation for me?
    1.>> when the player clicks on one of the squares
    What were the squares? Did it like dice or anything else?
    2.>> one of the 2 game pieces(red.png or yellow.png) will appear on the respective coordinates of the 2D array
    What is the 2 game pieces? Could you show us the two pictures?
    3.>> check if the square in the first row is empty and if true, places/display the game piece, else it places the piece on the first empty square
    Could you show us where places/display the game piece?
    Best Regards,
    Tony
    Help each other

  • How to disable mouse click on checkbox for each treeviewitem?

    treeview provode checkbox with state picture. When click on the pic, it will change the state pic.
    I want to have this on display, but only for display, not allow user click on it to switch state pic. It means checkbox is read-only.
    How to do it?

    Hi,
    You can do this :
    -Create a function :
    wf_set_checkbox_state (long al_tvihandle, long al_state) {
         treeviewitem ltvi
         tv_1.GetItem ( al_tvihandle, ltvi)
         ltvi.statepictureindex = al_state
         tv_1.SetItem ( al_tvihandle, ltvi )
    -In the Clicked Event of the treeview add this code :
    long  ll_state
    treeviewitem ltvi
    tv_1.GetItem ( handle, ltvi)
    ll_state = ltvi.statepictureindex
    post wf_set_checkbox_state (handle, ll_state)
    Regards.
    Abdallah.

  • Jtable in cell how to single mouse click make the cell selected.

    it seems need double click make cell selected.
    thanks!!!

    Hi,
    these link will help you.
    It has code for both examples, with 1 click and with 2 clicks:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=362073&tstart=0&trange=15
    sergio.

  • Simulate mouse clicks inLabview

    Hi,
    I have a standalone driver that needs to be called many times in another VI, I don't know how to simulate mouse clicks in Labview to simulate a user running this VI. (This VI has a loop inside it, so it will run until a specific key is pressed)
    Thanks
    Solved!
    Go to Solution.

    If you need to programatically run the VI use the Run VI method of VI server. If you need to simulate users pressing buttons on that VI then use user events.
    Attached is an example of a main VI that calls a SubVI and sends events to it. Open the SubVI front panel but do not run it. Open the Top Level VI and run it. Pressing the OK button on the Top Level or the SubVI will increment the numeric indicator on SubVI. Same with the stop button.
    =====================
    LabVIEW 2012
    Attachments:
    Top Level VI.vi ‏14 KB
    SubVI.vi ‏21 KB

  • How do I set my project to advance to next slide on mouse click vs just play?

    Captivate 6 on mac running OS 10.7.5 file format in question .htm (firefox)
    I'm brand new to Captivate 6 (never used it before) I have put together a mock presentation from scratch which has a few introductory slides then a quiz. When I publish it there is a "play" button which is NOT the behavior I want.
    I watched a training video from Lynda.com and the insstructor imported a PPT file, there was a dialog box which asked the how to advance slide, there was a drop down menu and one of two options was advance "on mouse click". This is the behavior I'm looking for.
    I've scoured the internet and forums etc to find a comparable option elsewhere in Captivate 6 when creating from scratch vs importing from PPT and cannot find one anywhere. I've also read that you can insert a click box object and that that would do what I'm looking for but that doesn't work either.
    Does any such option exist and if so where/ how do I get to it/ use it. Please see attachments below. First screen shot is the first slide I get which isn't the first slide either, what's up with that? Next one is simply to show how the project just "plays" instead of advancing slide by slide. Third is my publish dialog box. Bottom line I don't want a "play" button I want the user to mouse click next, next, next etc. How do I do this?
    Thank you for any help or suggestions!

    Maybe I understand something wrongly, but thought you also wanted to know how you can make slides advance on clicking the Next button instead of having it playing on automatically? And instead of using the playbar you want to have a Previous and Next button?
    The way imported PPT with advance on Mouse click works is because there is a click box added to each slide that pauses that slide at its end. The user has to click on the slide to advance.
    A click box is an 'interactive' object: this means that you can have it pausing the slide, that the user can interact with it and trigger an action like 'Go to Next Slide'.
    You added (from what I see on the last screenshot) another interactive object, but now I'm confused: the third screenshot has a Prev and Next arrow, I think those are shapes. You do not need to add a click box on top of them (what I see on the last screenshot), they can be converted themselves into buttons. I blogged a lot about those shape buttons. Anyway, both click box and shape button can pause the slide. This is the case by default for click boxes (at the end of their duration, their timeline), for shape buttons you have to tell them to pause in the Timing accordion. In your case I certainly would choose a shape button because they can be put on a master slide, or timed for the rest of the project whereas Click boxes need to be unique on each slide, you'l have a lot of copy/paste to do then. In the Action accordion, On Success you choose the action, I think in this case you want 'Go to Next Slide' for the Next 'thing'
    As for the first screenshot, Rod explained that you cannot get rid of the play button for pdf output, but you can have a poster image instead of the blank screen. There is a folder icon in Preferences, Project, Start and End when you deselect AuotPlay.
    Here is a link to an article where I explain shape buttons:
    http://lilybiri.posterous.com/why-i-like-shape-buttons-captivate-6
    There is an on-demand webinar as well on the Adobe site which I presented, only about shape buttons.
    Lilybiri

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

Maybe you are looking for

  • How do I pay for items on my wish list?

    I have created a wish list and want to purchase the songs and download them to a cd.  How do I do that?

  • Transfer call from fixed line to BB Z10

    Hello When you transfer calls from fixed line to BB Z10 the device only gives a split second notification of transfer call and then you do not see it any more. So it is difficult to see the difference between direct calls and my transfered call from

  • Need help on Mokia N-73 phone

    Hi All techies.. Am new to the forum, and need ur help Am planning to switch from Nokia N-73 Music edition to Nokia 7610 Supernova (looks very cool).. Need help on few points... 1) Had saved all my data (messages, contacts etc.) on the memory card in

  • How to Remove FreeHDSports Extension from a Mac

    Less a question than an answer to a previous thread located here: http://support.mozilla.org/en-US/questions/935485?page=2 FreeHDSports hides in ~/Library/Application Support/Mozilla/Extensions. This is outside of Firefox's standard profile, so even

  • How to make a photo [in iphoto ]into a poster

    i would like to make a photo into a poster using my printer ...i know the printer prints 8.5x11 sections that you trim & past together but i'm not sure how to do this [i have a canon pixma ip14000 printer] imac   Mac OS X (10.4.7)