![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Feb 2011
Posts: 6
![]() |
Hello,
How can I programmatically lock the axis so that the user cannot use the right button to tilt the globe in my application? Thanks, Matt |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,617
![]() |
Do a search in the SDK for:
RIGHT_PRESS DragSelectEvent pitch ../doc/gov/nasa/worldwind/event/DragSelectEvent.html ..\src\gov\nasa\worldwind\View.java void setPitch(Angle pitch); gov.nasa.worldwind.animation.Animator; gov.nasa.worldwind.awt.ViewInputHandler; I set my pitch (from horizontal) like this: view.setPitch(Angle.fromDegrees(90 - dPitch)); There should several ways to disable the user from changing the pitch. I have never done that but at least gave you places to look. |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
the easiest way is probably to add this line in your worldwind canvas:
getView().getViewPropertyLimits().setPit chLimits(Angle.ZERO, Angle.ZERO); limits the pitch to look straight down onto the earth. but you can set it to any Angle you want. |
|
|
|
#4 |
|
WWJ Technical Manager
Join Date: May 2007
Location: Seattle
Posts: 1,027
![]() |
Register a mouse handler with WW's input handler and mark consumed the events you don't want handled. Look at the LineBuilder example to see how to install your mouse handler.
|
|
|
|
|
|
#5 | |
|
Junior Member
Join Date: Feb 2011
Posts: 6
![]() |
Quote:
Worked like a charm! Thank you all for your replies! |
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Mar 2011
Posts: 4
![]() |
Cool, what a timely thread - I'm using this solution also. Thanks Matt, thanks Straider.
|
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Feb 2011
Posts: 6
![]() |
Quote:
Double thanks! While I took the quick and lazy solution to my original problem, this bit of direction pushed me in the right direction for another task - how to use a button to toggle mouse navigation on and off! |
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jun 2012
Posts: 10
![]() |
I am trying to create a button that toggles a generic view. (For example profile view or top down view.) I get a 'getView() is undefined' error when I try the command line above.
help please? I've tried setView() too. I'm really just stabbing in the dark now cuz none of the commands from the library I found seem to work anymore. WS: MAC OS X 10.7 |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jun 2012
Posts: 10
![]() |
Figured it out!
BasicOrbitView view = (BasicOrbitView) wwjPanel.getWwd().getView(); view.setZoom(8e4); view.setPitch(Angle.fromDegrees(0)); |
|
|
|
|
|
#10 | |
|
Super Moderator
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,617
![]() |
Quote:
From post #2: I set my pitch (from horizontal) like this: view.setPitch(Angle.fromDegrees(90 - dPitch)); I should have put this line in also for those that are not familiar: BasicOrbitView view = (BasicOrbitView) wwjPanel.getWwd().getView(); |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tilt and animation question | fabio.portieri | Development Help | 2 | 01-22-2010 05:50 PM |
| DirectX Screen Lock Issue | beaker | Bug Reports | 13 | 08-02-2009 02:58 PM |
| Tilt and angle on status bar | guerreiro.nma | Development Help | 1 | 06-18-2009 01:23 PM |
| Tilt View: Add Distance movement in the Interface | canosso | Suggestion Box | 0 | 08-23-2005 04:04 PM |
| Only one part of planet axis visible? | Thomas Risan | Bug Reports | 1 | 11-27-2004 01:44 PM |