You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -38,19 +38,30 @@ Here is an example of the Grand Canyon.
38
38
| latitude | latitude | 37.7983222 |
39
39
| longitude | longitude | -122.3972797 |
40
40
| elevation | for lod | 600 |
41
+
| lod | optional ||
41
42
| radius | planet size | 6372798 |
42
43
| world_radius | planet size | 6372798 |
43
44
| observer | who to watch | #camera |
44
45
| stretch | height scale | 1 |
45
46
| groundTexture | texture fx ||
46
47
| buildingTexture | texture fx ||
47
48
48
-
A-Terrain is the main AFrame component that you interact with. It is a wrapper to manage a bunch of individual A-Tile, A-Building and A-Location objects. You give it a longitude, latitude and elevation and it will make sure that that piece of the planet is rendered.
49
+
A-Terrain is the main AFrame component that you interact with in this package. You give it a longitude, latitude and elevation and it will make sure that that piece of the planet is rendered.
50
+
51
+
You may optionally specify a lod (level of detail or zoom level) which forces a specific resolution of tiles (to understand LOD see https://wiki.openstreetmap.org/wiki/Zoom_levels ). It will produce erratic behavior so it's best to think through what's going on here when you use it. It's worth noting as well that I've slightly modified the orbit controller that you may be used to so that it "slows down" as you get closer to the surface of the planet because otherwise you'd zoom from space to face too fast.
52
+
53
+
Depending on if you set an observer or not you will get different outcomes:
49
54
50
-
There are two slight variations in the way it will render the planet.
51
55
1) If you specify an observer (which is a DOM node id such as "#camera") then A-Terrain will paint tiles to cover the visible portion of the globe at the given elevation. For example if you used an elevation like 600 (meters above sea level) and you were over the default latitude and longitude (San Francisco) then it would paint a few tiles around downtown San Francisco at almost street level.
56
+
52
57
2) If you do not specify an observer then it will move and orient the entire globe so that you're standing on the ground at that point on the globe. By this I mean it moves and rotates the surface of the globe to intersect (0,0,0). This is intended to reduce the hassle of having to deal with spherical coordinates.
53
58
59
+
The 'stretch' argument stretches the planet so that you can see height related details better (such as mountains).
60
+
61
+
The radius is your model radius. The world_radius is the radius of your planet.
62
+
63
+
The groundTexture and buildingTexture are art-effects that you can use to thematically make buildings and ground match your application.
<!-- just print a single tile, and knowing the elevation (which in this part of SF is about 29 meters below world ellipsoid - place it at the origin facing up by hand -->
// How much to stretch planet heights by so that mountains are more visible
42
42
// TODO not fully implemented
43
43
stretch: {type: 'number',default: 1},
44
-
// LOD = Level of detail. This is for internal use only and is manufactured from the elevation. 15 = the first level where 3d building geometry is allowed to be seen.
45
-
lod: {type: 'number',default: 15},
44
+
// LOD = Level of detail. If not specified then it will be computed from elevation.
45
+
lod: {type: 'number',default: -1},
46
+
input: {type: 'number',default: 0},
46
47
// fovpad is a hack to circumvent limits with observer field of view; basically a camera could be near the planet but see the whole planet at once
47
48
// TODO the tilings strategy should be improved to deal with some of the possible cases of observer field of view - remove this fudge factor later
0 commit comments