How can I transform a 3D world coordinate to a 2D device coordinate?

I have been working with Java 3D for a few months and I can create a scene graph and display it. Now, I want to transform a 3D world coordinate to a 2D device coordinate. I don't want to draw the 3D point in the scene, I just want to know what the 2D coordinates would be. Does anyone know what sequence of transformations must be made to do this?

Thank you for your reply. I used your code and it solved most of my problems. However, I can't get it to apply a perspective projection to the point in question.
I took the following line of code from your response above.
view.getCanvas(0).getPixelLocationFromImagePlate(somePointInNode, awtPoint);From your code, and the javadoc that I've read, it appears that it should perform a perspective projection, but in my case it doesn't.
I have included output from my program below. I wrote a program that displays the x, y, and z axes on a Canvas3D. The viewpoint is looking down the z-axis with the positive x-axis pointing to the right and the positive y-axis pointing up. I then used your code to compute 2D points at the origin and along each of the three axes (calls 1-4 in my output). On the Canvas3D, the origin and the point along the positive z-axis are at two distinct locations, as one would expect of a perspective projection. However, when I compute the 2D location using your code, the 2D points are identical, as one would expect of a parallel projection. My view's projection policy is PERSPECTIVE_PROJECTION, but as my output below shows, the transformation from somePointInNode to awtPoint in calls 1 and 4 appears to be created as if it is a parallel projection. It is as if the z component is ignored. Why? Am I doing something wrong?
My output:
projection policy = perspective projection
call 1:
somePointInNode
origin: x=0.12699998915195465 y=0.15931445360183716 z=0.0
awtPoint
x=445.999961562044 y=435.4999675525455
call 2:
somePointInNode
x-axis: x=0.2528710961341858 y=0.15931445360183716 z=0.0
awtPoint
x=891.9999469321543 y=435.4999675525455
call 3:
somePointInNode
y-axis: x=0.12699998915195465 y=0.2851855605840683 z=0.0
awtPoint
x=445.999961562044 y=-10.500017817564867
call 4:
somePointInNode
z-axis: x=0.12699998915195465 y=0.15931445360183716 z=0.12587110698223114
awtPoint
x=445.999961562044 y=435.4999675525455

Similar Messages

  • How can we transform a video from progressive to interlaced with final cut?

    How can we transform a video from progressive (720x1080 50p) to interlaced (PAL) with final cut pro???????
    The video is taken with Sony EX3

    Hi Nick
    Sorry but your first link says +"The file you are trying to access is temporarily unavailable."+ ... but tell me, are you viewing these interlaced encodes yourself on an interlaced monitor (eg are you burning them to disc and viewing on a TV) as they are meant to be seen, or are you just playing them back from file on your (progressive) computer display?
    By the way, I did manage to download your source file and encoded it here. Looks ok to me ... in a addition to the instruction above, I also changed the Field Dominance in the Encoder > Video Format tab to Top First (it defaulted to progressive due to the progressive source file).
    Let me know if that helps
    Andy

  • How can i transform MFC HWND into jpanel or jframe instance

    Hi!
    I want to open a MFC window, then with the HWND , i want to open java subwindow created inside the MFC window with the HWND, i wonder if there is a way. how can i transform the HWND into jpanel or jframe instance.

    Look at the article in CodeProject and read the example in it. The other questions you can send to my email because I cannot give you concrete response in this forum.

  • How can I transform XML-DB to Relational DB?

    How can I transform XML-DB to Relational DB?
    I want to transform Oracle 9i XML-DB to Oracle 8i R-db
    please tell me how to do this .
    thank you

    hi
    good
    its idoc_xml or idoc_xml_transform
    go through the below link hope it ll help you to solve your problem
    Check with below link :
    Re: IDOCS_OUTPUT_IN_XML_FORMAT -- IDOCS_OUTPUT_TO_FILE
    Re: any function module to write-xml schema of a idoctype to an internal table
    /people/michal.krawczyk2/blog/2005/11/13/xi-how-to-check-your-idocs-on-a-web-page-from-sapgui -> this will help you
    thanks
    mrutyun^

  • After upgrading to Photos, how can I work on a Book Project from another apple device?

    After upgrading to Photos, how can I work on a Book Project from another apple device?

    I'm not sure I understand what you are asking, but on the device/Settings, do you have iCloud and Photos sync turned on?

  • We have a large family, 5 kids and two adults all with iPads, iPhones, Mac Books, Servers....  How can we combine our purchases to use on all our devices.  We have two Apple ID's and sometimes buy multiple copies because of how we are limited...

    We have a large family, 5 kids and two adults all with iPads, iPhones, Mac Books, Servers....  How can we combine our purchases to use on all our devices.  We have two Apple ID's and sometimes buy multiple copies because of how we are limited...

    Hello Halfback71,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/ht5622
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    Best of luck,
    Mario

  • HT1660 How can I maintain two separate itunes accounts on one single device without erasing either set of data?

    How can I maintain two separate itunes accounts on one single device (iPhone 4) without erasing either set of data when syncing with itunes?

    Hi,
    Depends on what you trying to setup but for purchases, you can roll down at the very end of the iTunes/AppStore pages to logout of your current account and then login into a different one.  Then your purchase will be billded to this new account.  Everything will sync as you used to but in order to use the purchased content in iTunes or other devices, you will need to authorize them (you can have up to 5 devices authorized for an account).

  • We have itunes music on a computer, an ipod nano, and a new ipod touch under two different accounts. How can we combine the music from both accounts to one device?

    We have itunes music on a computer, an ipod nano, and a new ipod touch under two different accounts. How can we combine the music from both accounts to one device?

    There is no "adding" a device.  Simply plug the iDevice into the computer.  iTunes should automatically detect the device when it is connected.
    iTunes can sync/manage as many iDevices as you want... there is no 1 device limit.

  • How can I get my ical to sync on all ios devices (imac, macbook, ipad, iphone)?

    How can I get my ical to sync on all ios devices (imac, macbook, ipad, iphone)?

    Setup iCloud on all the devices and computers as described here: http://www.apple.com/icloud/setup/

  • How can I remove default alarm for events in iCal on devices ios?

    Whenever I add an event to my iCal calendar in Mounain Lion it will automatically add one default alert only on my iphone and ipad. These default alarms are not displayed on my macbook or icloud.com
    Default alarms are disabled in macbook, icloud.com, and my ios devices.
    How can I remove default alarm for events in iCal on devices ios?
    Thanks and sorry for my english.
    MacBook Pro, Mac OS X 10.8

    OK, so I have had this issue for the past several months. I think it all started when I upgraded to ML from SL and migrated my calendars and contacts to iCloud. That was a couple months ago. But now I am running 10.8.2, and about two weeks ago I upgraded my iOS devices to 6.0.1.
    I don't seem to be having any issues with events that I create now, but all those old events that were migrated to iCloud a couple months ago, many of those sound alerts on the iOS devices even though there was no alert defined when the event was originally created. I have always had alerts off by default both in iCal and on the iOS devices.
    So here's the question: is there a way to go through and disable all these spurious event alerts? I've been disabling them as the event reminders come up, but it's irritating. It would be nice if there was a way to turn them off all in one shot somehow.

  • I bought a used iPhone and found him email iCloud does not affect me so how can I deleted this email in order to use the device freely and privacy

    I bought a used iPhone and found him email iCloud does not affect me so how can I deleted this email in order to use the device freely and privacy
    help me please

    You can't. Return the phone for a refund, if you can, because without the previous owner's Apple ID/Password, you will not be able to re-activate the phone. It will be useless to you.
    Apple can't/won't help you with this.

  • How can I connect Bluetooth in iPad retina with non apple devices ?

    How can I connect Bluetooth in iPad retina with non apple devices ?

    What devices?
    The iPad can only pair with earphones, speakers and keyboards.
    It cannot directly pair with other phones or computers for file transfer or other operations.
    Most Bluetooth devices will have a user guide to connect them to other devices. follow that to start the process.
    From the iPad side, its just a matter of going inot Settings->BlueTooth turning it on, and searching for the device to pair. 

  • I just downloaded iCloud on my PC and noticed that fewer than half of my photo stream photos have transferred over to my PC.  Why is this happening and how can I get the remaining photos?  All of my devices are charged and have perfect internet signals.

    I just downloaded iCloud on my PC and noticed that fewer than half of my photo stream photos have transferred over to my PC.  Why is this happening and how can I get the remaining photos?  All of my devices are charged and have perfect internet signals.  Thanks in advance for any tips and insights!

    It's probably happing because photo stream photos only remain in iCloud for 30 days (even though your last 1000 photos will remain on your devices until deleted).  When you enabled photo stream on your PC you would have only received photos from the last 30 days.
    To transfer older photos to your computer, create a shared photo stream that contains them and invite yourself as a subscriber (see http://help.apple.com/icloud/#mmc0cd7e99).

  • HT201441 where and how can i find his id to contact him if the device is not activated and idon't know how to riech him

    where and how can i find his id to contact him if the device is not activated and idon't know how to riech him

    i will have to agree with hasscoo90. we badly need help how to contact the owner of this phone. we do understand the purpose of activation lock. and this is why instead asking Apple or any other company that offers a service (if there is any) to remove the activation lock for us, help us provide any contact information of the owner of this serial number we have and we will inform them of exactly what to do so that we can already use this iphone.
    please help us. we really badly need your help.

  • How can i logout of find my iphone on a old device I ain't got

    How can i logout of find my iphone on a old device I ain't got

    Welcome to the Apple community.
        1.    Sign in to their iCloud account at www.icloud.com/find.
        2.    Select the device from their Find My iPhone device list by clicking All Devices at the top of the screen.
        3.    Erase the device by clicking the Erase button. This will erase all content and settings from the device. When prompted, do not enter a phone number or message. Click Next until the device is erased.
        4.    When the erase is complete, click "Remove from Account" to remove the device from the account.

Maybe you are looking for

  • Windows Update on Windows 7 (x64) on boot camp fails

    Running Windows 7 x64 on Boot Camp and trying to install an "important" update from windows update, but it fails: Update for Windows 7 for x64-based Systems (KB2506014) - Published: 4/12/2011. I received error code 80073712 and ran System Update Read

  • Any known issues with Unicode apps in System 9 Analytic Services ?

    We have installed System 9.2.0.2 Analytic Services on an AIX server. It was installed as a non-Unicode server. I am exploring enabling the server for Unicode, and then setting non-ASO apps to Unicode enabled. We don't need multi-lingual features, but

  • PO Amendment Data

    Hi everybody, When PO (Purchase Order) amendment is done, e.g. deli. date change, price change, incoterm change, item deletion etc., So can you Please tell me that these changes get store where exactly? Or how to see these changes So that we can use

  • Two delta initializations?

    Hello gurus! I have a doubt. I enhance the 2LIS_12_VCITM datasource with a Z field that is filled with an exit with a date. I use a delta init. in BW with the posting date, now I added a cube that loads data from the 2LIS_12_VCITM datasource but I wa

  • Struts-example-code in Eclipse

    Hello, i downloaded these Struts-Example-war-files (struts-el-example-1.3.8, etc.) and i want to edit and compile some of the java-files with Eclipse. How can i make an Eclipse-project out of it? My trials brought me only the errormessages like: The