Results 1 to 6 of 6

Thread: Problem with drawing multiple Spherical Domes

  1. #1
    Unregistered
    Guest

    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?

  2. #2
    WWJ Consultant patmurris's Avatar
    Join Date
    Jun 2005
    Location
    Saint-Paul de Vence, Alpes Maritimes, France
    Posts
    3,382

    Default

    Some screenshots and code would help answer your question...
    My World Wind Java Blog & WW.net Plugins page

  3. #3
    Senior Member
    Join Date
    Apr 2006
    Posts
    401

    Default

    Also, please register. Makes things a lot easier!
    Machine. Unexpectedly, I’d invented a time
    - Alan Moore

  4. #4
    Junior Member
    Join Date
    Jun 2007
    Posts
    2

    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 Attached Images

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Posts
    2

    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.

  6. #6
    WWJ Consultant patmurris's Avatar
    Join Date
    Jun 2005
    Location
    Saint-Paul de Vence, Alpes Maritimes, France
    Posts
    3,382

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •