World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 08-08-2012, 08:22 PM   #11
shanrak
Junior Member
 
Join Date: Jul 2012
Posts: 10
shanrak is on a distinguished road
Default

Quote:
Originally Posted by nlneilson View Post
Pat Murris coded the Grid layer as well as several others and did an excellent job.

You may not understand he wanted and did accomplish.

Look at how the levels (10 deg, 1.0, 0.1, 0.01, etc) are turned off and on.

Code:
        public double getSizeInPixels(DrawContext dc)
        {
            View view = dc.getView();
            Vec4 centerPoint = getSurfacePoint(dc, this.sector.getCentroid().getLatitude(),
                this.sector.getCentroid().getLongitude());
            double distance = view.getEyePoint().distanceTo3(centerPoint);
            double tileSizeMeter = this.sector.getDeltaLatRadians() * dc.getGlobe().getRadius();
            return tileSizeMeter / view.computePixelSizeAtDistance(distance);
        }
If you look at a picture down a long straight railroad pair tracks at the bottom there will be many pixels between the individual tracks. At the top the individual tracks blend into one so there are very few pixels in between.

How many pixels there are between the latlon determines the resolution (10, 1, .1, .001, ---) grid lines are displayed. At the near point and at the far point. There will be less grid lines farther out.
view.computePixelSizeAtDistance(distance )

edit: in your post #7 image it looks like you just changed to:
MIN_CELL_SIZE_PIXELS = 20

Understand what the code is actually doing.
If you take a look at the code, you'll see that getSizeInPixels is used in exactly three places, line 357, 396 and 417. All of these compares that/divisions vs MIN_CELL_SIZE_PIXELS. Again, I've said that this does nothing. If you comment out those checks, you'll see that the same behavior happens as before. (See attachment)

Let me just repeat(for the 4th time) what I've already said, MIN_CELL_SIZE_PIXELS doesn't affect the rendering distance of the grid, just its density.

I want the behavior to be, when it decides to draw the next layer of grids, to do it for all visible sectors at once rather than the just the closest sectors.
Attached Images
File Type: png Untitled.png (214.0 KB, 17 views)

Last edited by shanrak; 08-08-2012 at 08:27 PM.
shanrak is offline   Reply With Quote
Old 08-08-2012, 10:30 PM   #12
nlneilson
Super Moderator
 
Join Date: Nov 2006
Location: Mojave & Oxnard California
Posts: 2,620
nlneilson is on a distinguished road
Default

Quote:
Originally Posted by shanrak View Post
".. the rendering distance of the grid, just its density.
Maybe it's like apples and oranges.

The distance represented by the lower third of your image is "higher density".
The distance from there is a lower density.
Like the top is 10 deg and the bottom is 1 deg.
I am getting the impression you don't like it that way and want to change it.
AFAIK that issue may have not come have up before.
It has been a long time since debugging through the grid code and then and I was looking for something else, I think I changed it so it not be as dense.

When you slowly zoom in does the separation slowly creep up?
Mine creeps up.

The density on the bottom of yours is such that what is under that may not be distinguishable. Is that on purpose and do you want the full screen to be that way?
__________________
Neil
http://www.nlneilson.com

Last edited by nlneilson; 08-08-2012 at 11:14 PM.
nlneilson is online now   Reply With Quote
Old 08-09-2012, 12:19 AM   #13
shanrak
Junior Member
 
Join Date: Jul 2012
Posts: 10
shanrak is on a distinguished road
Default

Quote:
Originally Posted by nlneilson View Post
Maybe it's like apples and oranges.
I am getting the impression you don't like it that way and want to change it.
AFAIK that issue may have not come have up before.
That is exactly it. I do not like the way its being handled right now.

Quote:
Originally Posted by nlneilson View Post
When you slowly zoom in does the separation slowly creep up?
Mine creeps up.

The density on the bottom of yours is such that what is under that may not be distinguishable.
Yes, mine creeps up as you pan and zoom but I don't want the creep effect, I would like it to draw all the grids within the visible field of view rather than render them as you 'creep up'.

Quote:
Originally Posted by nlneilson View Post
Is that on purpose and do you want the full screen to be that way?
That is just to illustrate the difference between 'near' and 'far'. I will space the grids out more if I can change the creeping behavior.
shanrak is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Distance between positions nigel25840 Development Help 3 04-07-2010 04:02 PM
Calculating the distance between two points ShadowCoder Development Help 4 12-14-2009 11:01 PM
Maximum camera distance asantiago Development Help 3 12-21-2007 10:32 PM
Tilt View: Add Distance movement in the Interface canosso Suggestion Box 0 08-23-2005 04:04 PM
WorldCamera.cs: Remove distance for tilted view? canosso Developers' Corner 4 08-20-2005 11:51 PM


All times are GMT +1. The time now is 07:50 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.