Results 1 to 7 of 7

Thread: KML Importer. Shapes shaking

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default KML Importer. Shapes shaking

    Hi:

    I´m developing using KML Importer.
    I have seen some problem that I´d like to fix. I load a shape, like the example of the Pentagon, and it shows ok in the globe. But when I zoom in the shape, and I do some movement with the mouse, the shape shakes some second after the globe has stopped, like an earthquake.
    Does it happends to anyone more? Do you know how to fix that or what is wrong??

    Regards.

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Posts
    217

    Default

    I'm not sure what code you're referring to, but when I've had this problem it was a floating point precision issue.

    The fix is to do your drawing near (0,0,0), because there is more precision available for smaller floating point values.

    So, if you're drawing your model at (50000.00003, 50000.000002, 50000.000003), choose a "reference center" so that the model is near the origin (0,0,0). For this example, the reference center should obviously be (50000, 50000, 50000). The reference center doesn't need to be any particular value, just choose one that puts the majority of your model near the origin;

    Code:
    Vec4 referenceCenter = (50000, 50000, 50000);
    
    // Then, subtract that from every point in your model
    
    for (point : modelPoints) {
       newPoint.subtract3(referenceCenter);
    }
    
    try {
        // Move the origin to the reference center
        dc.getView().pushReferenceCenter(dc, referenceCenter);
    
        // Then draw your model (this should be with the transformed points):
        model.draw
    }
    finally {
       // Be sure to restore the original origin
       dc.getView().popReferenceCenter(dc);
    }
    Last edited by remleduff; 04-19-2010 at 10:31 PM.

  3. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default

    Thanks for the answer.
    KML Importer is a project to use with WWJ, to load and show KML objects (http://code.google.com/intl/es-ES/ap...n/kml_tut.html).
    I´m drawing with 0,0,0 like reference center. The problem happens with the examples of library too, so I suppose something is not completely right in there, but I don´t know what.
    I don´t know if someone is using this library and has seen what I´m talking about.

  4. #4
    Senior Member
    Join Date
    Jun 2007
    Posts
    217

    Default

    I'm familiar with KML, what KML importer project are you using, though?

  5. #5
    Senior Member heidtmare's Avatar
    Join Date
    Feb 2008
    Location
    Melbourne, FL, USA
    Posts
    676

    Default

    If you are refering to this:
    http://code.google.com/p/wwj-kml/
    Its a third party contribution and You'd probably be better off posting your issue on its issue tracker.

    If you mean this:
    http://worldwindcentral.com/wiki/Add-on:KMLImporter
    That is a plugin for the old C# WorldWind and the Java team wont be very helpful concerning it.


    If its something else I'd like to know cause KML support in WWJ has been on the backburner for a while,
    and the people who have implemented their own parsers only implement a tiny portion of the spec and
    usually hide behind the "I cant release the source cause it was for a customer" wall.

  6. #6
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default

    Thanks for the answer.
    I´m using the first one, I´m developing in JAVA. It seems this project is very abandoned . In any case, I´ll post my issue there.
    I suppose nobody has suffered this same problem or knows how to fix it, hasn´t it?

    Regards

  7. #7
    Junior Member
    Join Date
    Apr 2010
    Posts
    18

    Default

    I have improved the performance at least partially.
    The problem appeared when I drag the mouse / the globe (with both buttoms). But it didn´t happen when I zoom in/out.

    The partial solution that I have applied, with MouseListener, when a button is released, I execute this code:

    Robot robotic = new Robot();
    robotic.mouseWheel(1);
    robotic.mouseWheel(-1);


    It doesn´t anything apparently, but the strange movement stop.
    If someone find a better way, please, tell me.

    Regards.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to shade an icon from KML Importer???
    By James_In_Utah in forum Developers' Corner
    Replies: 21
    Last Post: 04-23-2010, 08:47 PM
  2. Help with KML Importer
    By eric567 in forum WorldWind General
    Replies: 1
    Last Post: 12-16-2008, 06:34 PM
  3. Feature enhancements needed for KML Importer
    By James_In_Utah in forum Developers' Corner
    Replies: 0
    Last Post: 07-19-2008, 12:45 AM
  4. KML Importer change to load last loaded KML
    By James_In_Utah in forum Developers' Corner
    Replies: 7
    Last Post: 07-15-2008, 05:13 AM
  5. KML importer
    By coloradokid in forum Technical Support
    Replies: 15
    Last Post: 03-18-2007, 07:57 PM

Posting Permissions

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