Replies: 7 comments 3 replies
-
Since babylon is not primarily a geospatial framework, I think your best bet may be to review a similar integration built for three.js by a contributor. https://github.com/visgl/loaders.gl/tree/master/examples/experimental |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for your reply. i did actually look into that, but stull cannot figure out what the problem could be here. |
Beta Was this translation helpful? Give feedback.
-
Hi, i still cannot really figure it out - at least i do not think the values calculated by the viewport seem to be coorect. the zoomvalue and position is a mystery for me. zoom value just keeps around 15.xxx and camera position is
while the lat / lon seems to be correct. do i have to reproject the values to create the viewport beforehand? in what projection are the resulting viewport.position values? even try to reproject or unproject them i never get back to the original lat /lon. these are the values to create the viewport : {
"longitude": -75.61565118973338,
"latitude": 40.04175274005505,
"x": 1210,
"y": 403,
"up": [
0,
0,
1
],
"position": [
126.01094471568231,
-472.44879751179144,
100.98889042453851
],
"fovy": 45.83662361046586,
"projectionMatrix": [
0.7877559065818787,
0,
0,
0,
0,
2.365222454071045,
0,
0,
0,
0,
1.0002000331878662,
1,
0,
0,
-2.000200033187866,
0
],
"width": 1210,
"height": 403,
"pitch": 80.84002607482773,
"bearing": 20.068419650838877,
"focalDistance": 634.3860051210934
} the resulting viewport is this: {
"id": "Viewport",
"x": 1210,
"y": 403,
"width": 1210,
"height": 403,
"isGeospatial": true,
"zoom": 15.86919546031217,
"focalDistance": 634.3860051210934,
"position": [
126.01094471568231,
-472.44879751179144,
100.98889042453851
],
"modelMatrix": null,
"distanceScales": {
"unitsPerMeter": [
0.000016706911012382423,
0.000016706911012382423,
0.000016706911012382423
],
"metersPerUnit": [
59855.469347915016,
59855.469347915016,
59855.469347915016
],
"unitsPerDegree": [
1.4222222222222223,
1.8577156884046346,
0.000016706911012382423
],
"degreesPerUnit": [
0.703125,
0.5382955025043569,
59855.469347915016
]
},
"scale": 59855.46934791504,
"center": [
148.4598457837969,
318.2371190639275,
0.0016872124055620043
],
"cameraPosition": [
148.45984578379685,
318.2371190639274,
0.0016872124055622338
],
"projectionMatrix": [
0.7877559065818787,
0,
0,
0,
0,
2.365222454071045,
0,
0,
0,
0,
1.0002000331878662,
1,
0,
0,
-2.000200033187866,
0
],
"viewMatrix": [
56221.256428496774,
20277.00909093903,
-3269.623645984794,
0,
-20538.9273444454,
55504.306947799174,
-8949.948862607036,
0,
0,
9528.484844384433,
59092.17534859868,
0,
-1810349.9923863038,
-20673868.457882833,
3333514.063008176,
1
],
"viewMatrixUncentered": [
56221.256428496774,
20277.00909093903,
-3269.623645984794,
0,
-20538.9273444454,
55504.306947799174,
-8949.948862607036,
0,
0,
9528.484844384433,
59092.17534859868,
0,
0,
0,
0,
1
],
"viewMatrixInverse": [
0.000015692526320285997,
-0.000005732843383766566,
-1.3897560924115474e-22,
0,
0.0000056597365315186195,
0.000015492410753490167,
0.000002659599032674037,
0,
-9.126202148701734e-7,
-0.0000024981175628883015,
0.00001649385972297158,
0,
148.45984578379685,
318.2371190639274,
0.0016872124055622338,
1
],
"viewProjectionMatrix": [
44288.62682700275,
47959.637203291706,
-3270.2776792258232,
-3269.623645984794,
-16179.661330442925,
131280.0330905861,
-8951.739149409263,
-8949.948862607036,
0,
22536.98630721371,
59103.995744811604,
59092.17534859868,
-1426113.89948277,
-48898297.889095604,
3334178.876252963,
3333514.063008176
],
"pixelProjectionMatrix": [
24816496.924515862,
-10322696.061129214,
-3270.2776792258232,
-3269.623645984794,
-15203414.166795228,
-28256341.363568418,
-8951.739149409263,
-8949.948862607036,
35750766.0859022,
7365870.591839071,
59103.995744811604,
59092.17534859868,
1153977098.9328709,
10524710108.348911,
3334178.876252963,
3333514.063008176
],
"pixelUnprojectionMatrix": [
3.2926519274752795e-8,
-1.2028820235460284e-8,
1.0412156663357192e-22,
-1.8512840734899624e-24,
-1.187542526470045e-8,
-3.2506630840875966e-8,
-5.580448732169958e-9,
0,
-74.22249941904546,
-159.10264664587848,
-0.000843521836699463,
-0.4999499967630047,
74.23732794194945,
159.13448378488977,
0.0008613088891994329,
0.5000500033546309
],
"_frustumPlanes": {
"left": {
"distance": 25.032573615994536,
"normal": [
-0.5383302551918173,
0.32979907893899624,
-0.7755211820937599
]
},
"right": {
"distance": 62.464992734186524,
"normal": [
0.6241508356655388,
-0.09488219254373825,
-0.7755211820937599
]
},
"bottom": {
"distance": -296.44345891735423,
"normal": [
-0.2907522232203928,
-0.7958767770435687,
-0.5310774900663182
]
},
"top": {
"distance": 339.81899397792034,
"normal": [
0.33329641904817014,
0.912333109113146,
-0.23782723785472282
]
},
"near": {
"distance": 55.692706102291936,
"normal": [
0.054625311297449304,
0.14952599921294896,
-0.987247715077136
]
},
"far": {
"distance": -55.5256647109068,
"normal": [
-0.05462531129746264,
-0.14952599921295953,
0.9872477150771337
]
}
},
"longitude": -75.61565118973338,
"latitude": 40.04175274005505
} |
Beta Was this translation helpful? Give feedback.
-
Your viewports x,y and width, height seems to be the same. Is that intentional? |
Beta Was this translation helpful? Give feedback.
-
i am passing these values from the babylonjs camera. how are they supposed to look like? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
the only problem i am having now is, that in the corners sometimes the tiles are not loaded correctly. Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
Hi there,
i am trying to set up a geospacial viewport in babylon, to make loading of tiles possible. i am struggeling to set up the correct informations i need for the viewport.
currently i am gettings these informations from the babylon camera:
viewMatrix
,lat
,lon
, andheight
this looks for example like this:
with this i set up a new Viewport:
to then update my tileset with this viewport:
tileset.update(newViewport)
several propblems or missunderstandings here:
maybe someone coult look at the viewport object and figure what i am missing here?
any help would be just awesome!!! Thanks a lot!
here is the full viewport object:
Beta Was this translation helpful? Give feedback.
All reactions