![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2008
Posts: 5
![]() |
Big guys:
I'm a user from chinese.I know wwj recently and have lots of question.I wanna use wwj do some research.In my research I must draw a contour in wwj? but now I hardly how how to draw a line in WWJ. Any helps? Big guys, could u tell me how to make a self-defined layer and draw something such as line,text. thanx! |
|
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Welcome to the WorldWind forum findsnow
![]() Make sure to visit the World Wind Central wiki. There are a lot of links and documentation there, although it is not complete or very well organized, you will certainly find it a useful resource. As for drawing contour lines, this is a somewhat wide subject, as there are different approaches with various degrees of precision and complexity. Just to mention a few: - using a 1d texture with alternated transparent pixels and opaque pixels along with appropriate texture coordinates for the surface geometry. This allows you to 'project' lines horizontaly on the terrain - from the side intead of from the top. It produces contour lines without any complex computation, but with a rather coarse precision. You would have to tweak or replace the SDK SurfaceTileRenderer. - using predrawn contour lines and applying the corresponding texture over the terrain, like any other layer. This requires to compute the appropriate texture in all points of the terrain. You could try using a procedural layer. - you can do the above with a GLSL fragment shader - you can use GL lines instead of textures - see terrain following Polylines. This would probably be very slow with a lot of contour lines, but certainly nicer and more precise. You still have to compute where exactly the lines should be and produce somewhat closed polygones... Did you manage to compile and run WWJ? PS: please do not mention 'big guys' ![]() |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2008
Posts: 5
![]() |
Thanks lot for your advise.My english is poor ,so sorry!
I have compiled and run WWJ in a IDE(IntelliJ IDEA), and I have saw a example named LineBuilder. In this example I learned how to draw a line in WWJ, it is very useful! Now,I use two methods to draw contour in WWJ, --one is ur method(using a 1d texture with alternated transparent pixels and opaque pixels along with appropriate texture coordinates for the surface geometry).This method is so simply that I can draw contour quickly, but which come out another question, I can't hnow which level of contour I had draw, that's to say, I can't get the altitude of my contour. --another is: I produce contour data before I draw it(I have some position's Lon,Lat and Alt data),but this method is so complex that use few minutes to draw contour. I prefer to use ur method, is there any method in WWJ's class to get altitude from a Lon-Lat pair. do I must to set a HTTP connetion to "http://worldwind25.arc.nasa.gov/wwelevation/wwelevation.aspx?" with T,L,X and Y parameters? Last edited by findsnow; 05-27-2008 at 03:34 AM. |
|
|
|
|
|
#4 | |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Quote:
Use dc.getModel().getGlobe().getElevation(la t, lon) |
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2008
Posts: 9
![]() |
try to use gpx writer and reader to write a file.. then draw it on the globe
this may be easier.. worldwind supports gpx format.. |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2008
Posts: 9
![]() |
if you use texture make sure you have such image to show your contour and specify the coordinates for that image..
|
|
|
|
![]() |
| 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 |
| Interactively Draw Line | dinkinflicka | Development Help | 1 | 02-20-2008 10:43 PM |
| Pathline.cs draw Red line regards to any color that you pass into the method | fsulistio | Bug Reports | 8 | 07-18-2007 10:26 AM |
| Contour lines | judp | Technical Support | 4 | 06-14-2007 05:39 AM |
| how to draw line in WW's world | kinsung | Developers' Corner | 12 | 03-12-2007 02:08 AM |