World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 06-26-2007, 01:55 AM   #1
Unregistered
Guest
 
Posts: n/a
Red face Problem with drawing multiple Spherical Domes

Hi, I am currently working on drawing some 3D geometry into WW. I am using the Sphere class to draw domes on the earth surface. However, I encounter the problem that when drawing multiple domes, only the first dome will turn out right (as a half sphere) whereas the rest of the domes appear as spheres even though the elevation is set to be at ground level. Is this a WWJ bug or have i done something wrong?
  Reply With Quote
Old 06-26-2007, 02:12 AM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

Some screenshots and code would help answer your question...
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 06-26-2007, 02:25 AM   #3
Chade
Senior Member
 
Join Date: Apr 2006
Posts: 407
Chade is an unknown quantity at this point
Default

Also, please register. Makes things a lot easier!
__________________
Machine. Unexpectedly, I’d invented a time
- Alan Moore
Chade is offline   Reply With Quote
Old 06-26-2007, 02:37 AM   #4
Kimson
Junior Member
 
Join Date: Jun 2007
Posts: 2
Kimson is on a distinguished road
Default

Hi, I just registered my account. Attached is the screenshot from my testing of drawing domes.

Code:
public Renderable renderDome(Dome _dome) {
gov.nasa.worldwind.Globe _globe =  new gov.nasa.worldwind.globes.Earth();

gov.nasa.worldwind.geom.Point _domeCenterPt = _globe.computePointFromPosition(
				_dome.getCenterPosition().getLatitude(), _dome.getCenterPosition().getLongitude(), 
				_globe.getElevation(_dome.getCenterPosition().getLatitude(), 
						_dome.getCenterPosition().getLongitude()));

Sphere _domeShape = new Sphere(_domeCenterPt, _dome.getRadius(), _dome.getColor());

return _domeShape;
}
The above function returns a Sphere instance. Which is then added into a renderable layer for display in the actionPerformed method of a command button.
Attached Images
File Type: jpg dome_screenshot.JPG (78.5 KB, 292 views)
Kimson is offline   Reply With Quote
Old 06-27-2007, 03:57 AM   #5
Kimson
Junior Member
 
Join Date: Jun 2007
Posts: 2
Kimson is on a distinguished road
Default

I solved my problem already. Apparently, I made an error while modifying the render() code of the Sphere class in order to make it possible to set the color and transparency of the Sphere.
Kimson is offline   Reply With Quote
Old 06-27-2007, 06:07 AM   #6
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

I quickly looked into your issue and the code looks right.
Except maybe the getElevation() that will probably not return a very accurate value at startup - before elevation data gets cached.
For better placement, you would probably need to update the elevation component of each dome center, whenever better elevation data is available.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Reply

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:24 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.