![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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?
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Some screenshots and code would help answer your question...
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2006
Posts: 407
![]() |
Also, please register. Makes things a lot easier!
![]()
__________________
Machine. Unexpectedly, I’d invented a time - Alan Moore |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jun 2007
Posts: 2
![]() |
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;
}
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jun 2007
Posts: 2
![]() |
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.
![]() |
|
|
|
|
|
#6 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
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. |
|
|
|
![]() |
| Tags |
| None |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|