![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2010
Posts: 18
![]() |
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 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
![]() |
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 09:31 PM. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2010
Posts: 18
![]() |
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 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
![]() |
I'm familiar with KML, what KML importer project are you using, though?
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 675
![]() |
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 |
|
Junior Member
Join Date: Apr 2010
Posts: 18
![]() |
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 |
|
Junior Member
Join Date: Apr 2010
Posts: 18
![]() |
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. |
|
|
|
![]() |
| 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 |
| How to shade an icon from KML Importer??? | James_In_Utah | Developers' Corner | 21 | 04-23-2010 07:47 PM |
| Help with KML Importer | eric567 | WorldWind General | 1 | 12-16-2008 05:34 PM |
| Feature enhancements needed for KML Importer | James_In_Utah | Developers' Corner | 0 | 07-18-2008 11:45 PM |
| KML Importer change to load last loaded KML | James_In_Utah | Developers' Corner | 7 | 07-15-2008 04:13 AM |
| KML importer | coloradokid | Technical Support | 15 | 03-18-2007 06:57 PM |