ipad - Issue while Creating Latitudes-Lines on Globe using WhirlyGlobeComponet -
i working on whirlyglobe component tester application (great framework globe app in ios mousebird team)and trying create latitudes , longitudes. have created longitudes on globe using method : - (void)addgreatcircles:(locationinfo *)locations len:(int)len stride:(int)stride offset:(int)offset
, assigning values in array :locationinfo locations[numlocations]
but when try create latitudes on globe giving coordinates in as:
locationinfo locations[numlocations] = { {"twenty five",0, 180}, {"twenty six",0, -10} // {"three",30,180.0}, // {"four",30,0}, // {"five",60, 180}, //{"six",60, 0}, }
and son on... able half latitude line on globe. not know why issue coming up.is due opengl or what.somebody please me correctly. screenshot when give starting points(0,-180) end point(0,0) comes shown in images- 1,2:
image-1
image-2
and need complete latitude line drawn on globe .using start point(0,0) end point(0,360) gives me blank output(no line drawn on globe). have tried start point(0,10) end point (0,-10) line covers complete globe no success yet.please guys!!
first, you'll want move develop branch on github. that's version 2.2 released.
i've added example in test app this.
here's how pull off.
- (void)addlineslon:(float)londelta lat:(float)latdelta color:(uicolor *)color { nsmutablearray *vectors = [[nsmutablearray alloc] init]; nsdictionary *desc = @{kmaplycolor: color, kmaplysubdivtype: kmaplysubdivsimple, kmaplysubdivepsilon: @(0.001), kmaplyvecwidth: @(4.0), kmaplydrawpriority: @(1000)}; // longitude lines (float lon = -180;lon < 180;lon += londelta) { maplycoordinate coords[3]; coords[0] = maplycoordinatemakewithdegrees(lon, -90); coords[1] = maplycoordinatemakewithdegrees(lon, 0); coords[2] = maplycoordinatemakewithdegrees(lon, +90); maplyvectorobject *vec = [[maplyvectorobject alloc] initwithlinestring:coords numcoords:3 attributes:nil]; [vectors addobject:vec]; } // latitude lines (float lat = -90;lat < 90;lat += latdelta) { maplycoordinate coords[5]; coords[0] = maplycoordinatemakewithdegrees(-180, lat); coords[1] = maplycoordinatemakewithdegrees(-90, lat); coords[2] = maplycoordinatemakewithdegrees(0, lat); coords[3] = maplycoordinatemakewithdegrees(90, lat); coords[4] = maplycoordinatemakewithdegrees(+180, lat); maplyvectorobject *vec = [[maplyvectorobject alloc] initwithlinestring:coords numcoords:5 attributes:nil]; [vectors addobject:vec]; } latlonobj = [baseviewc addvectors:vectors desc:desc]; }
whirlyglobe-maply 2.2 adds few tricks vector rendering , subdivision. can tell toolkit subdivide lines epsilon make them acceptable. can render 1 thing on top of without worrying z buffering. there go, it's pretty easy now.
the real trickery here have break lines pieces. need @ least 3 points or subdivision logic detect degenerate case. 5 point lines latitude works error test logic.
Comments
Post a Comment